Skip to content

Commit

Permalink
chore: update schema form
Browse files Browse the repository at this point in the history
  • Loading branch information
leleueri committed Jul 5, 2023
1 parent 4eae4a4 commit 2106b08
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions src/main/resources/schemas/schema-form.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"type" : "object",
"id" : "urn:jsonschema:io:gravitee:policy:requestvalidation:configuration:RequestValidationPolicyConfiguration",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"properties" : {
"scope" : {
"title": "Scope",
"description": "Execute policy on <strong>request</strong> or <strong>request-content</strong> phase.",
"description": "Execute policy on 'request' or 'request-content'.",
"type" : "string",
"default": "REQUEST",
"enum" : [ "REQUEST", "REQUEST_CONTENT" ],
"deprecated": true
},
"status" : {
"title": "Status Code",
"description": "HTTP Status Code send to the consumer in case of validation issues",
"description": "HTTP Status Code send to the consumer in case of validation issues.",
"type" : "string",
"default": "400",
"enum": [
Expand Down Expand Up @@ -115,6 +116,12 @@
"505": "505 - HTTP_VERSION_NOT_SUPPORTED",
"507": "507 - INSUFFICIENT_STORAGE"
}
},
"gioConfig": {
"banner": {
"title": "HTTP Status Code send to the consumer in case of validation issues.",
"text": "<ul><li>100 - CONTINUE</li><li>101 - SWITCHING_PROTOCOLS</li><li>102 - PROCESSING</li><li>200 - OK</li><li>201 - CREATED</li><li>202 - ACCEPTED</li><li>203 - NON_AUTHORITATIVE_INFORMATION</li><li>204 - NO_CONTENT</li><li>205 - RESET_CONTENT</li><li>206 - PARTIAL_CONTENT</li><li>207 - MULTI_STATUS</li><li>300 - MULTIPLE_CHOICES</li><li>301 - MOVED_PERMANENTLY</li><li>302 - FOUND OR MOVED_TEMPORARILY</li><li>303 - SEE_OTHER</li><li>304 - NOT_MODIFIED</li><li>305 - USE_PROXY</li><li>307 - TEMPORARY_REDIRECT</li><li>400 - BAD_REQUEST</li><li>401 - UNAUTHORIZED</li><li>402 - PAYMENT_REQUIRED</li><li>403 - FORBIDDEN</li><li>404 - NOT_FOUND</li><li>405 - METHOD_NOT_ALLOWED</li><li>406 - NOT_ACCEPTABLE</li><li>407 - PROXY_AUTHENTICATION_REQUIRED</li><li>408 - REQUEST_TIMEOUT</li><li>409 - CONFLICT</li><li>410 - GONE</li><li>411 - LENGTH_REQUIRED</li><li>412 - PRECONDITION_FAILED</li><li>413 - REQUEST_ENTITY_TOO_LARGE</li><li>414 - REQUEST_URI_TOO_LONG</li><li>415 - UNSUPPORTED_MEDIA_TYPE</li><li>416 - REQUESTED_RANGE_NOT_SATISFIABLE</li><li>417 - EXPECTATION_FAILED</li><li>422 - UNPROCESSABLE_ENTITY</li><li>423 - LOCKED</li><li>424 - FAILED_DEPENDENCY</li><li>429 - TOO_MANY_REQUESTS</li><li>500 - INTERNAL_SERVER_ERROR</li><li>501 - NOT_IMPLEMENTED</li><li>502 - BAD_GATEWAY</li><li>503 - SERVICE_UNAVAILABLE</li><li>504 - GATEWAY_TIMEOUT</li><li>505 - HTTP_VERSION_NOT_SUPPORTED</li><li>507 - INSUFFICIENT_STORAG</li></ul>"
}
}
},
"rules" : {
Expand All @@ -123,41 +130,58 @@
"items" : {
"type" : "object",
"title" : "Rule",
"id" : "urn:jsonschema:io:gravitee:policy:requestvalidation:Rule",
"properties" : {
"input" : {
"type" : "string",
"title": "Field value",
"description": "The input value to validate (supports EL)",
"description": "The input value to validate. (supports EL)",
"x-schema-form": {
"expression-language": true
}
},
"isRequired" : {
"type" : "boolean",
"title": "Required",
"description": "If true, check the pattern always. If false check the pattern, only if this one is present in the request",
"description": "If true, check the pattern always. If false check the pattern, only if this one is present in the request.",
"default": true
},
"constraint" : {
"type" : "object",
"title" : "Constraint",
"id" : "urn:jsonschema:io:gravitee:policy:requestvalidation:Constraint",
"properties" : {
"type" : {
"type" : "string",
"enum" : [ "NOT_NULL", "MIN", "MAX", "MAIL", "DATE", "PATTERN", "SIZE", "ENUM" ],
"default": "NOT_NULL",
"title": "Type",
"description": "The constraint rule to apply to the field value.<ul><li>NOT_NULL: Field value is required</li><li>MIN: Field number value is greater or equals than parameter</li><li>MAX: Field number value is lower or equals than parameter</li><li>MAIL: Field value is a valid email</li><li>PATTERN: Field value is valid according to the pattern parameter</li><li>DATE: Field value is valid according to the date format parameter</li><li>SIZE: Field value length is between min and max parameters</li><li>ENUM: Field value included in ENUM</li><ul/>"
"description": "The constraint rule to apply to the field value.",
"x-schema-form": {
"type": "select",
"titleMap": {
"NOT_NULL": "NOT_NULL: Field value is required",
"MIN": "MIN: Field number value is greater or equals than parameter",
"MAX": "MAX: Field number value is lower or equals than parameter",
"MAIL": "MAIL: Field value is a valid email",
"PATTERN": "PATTERN: Field value is valid according to the pattern parameter",
"DATE": "DATE: Field value is valid according to the date format parameter",
"SIZE": "Field value length is between min and max parameters",
"ENUM": "ENUM: Field value included in ENUM"
}
},
"gioConfig": {
"banner": {
"title": "Type",
"text": "The constraint rule to apply to the field value.<ul><li>NOT_NULL: Field value is required</li><li>MIN: Field number value is greater or equals than parameter</li><li>MAX: Field number value is lower or equals than parameter</li><li>MAIL: Field value is a valid email</li><li>PATTERN: Field value is valid according to the pattern parameter</li><li>DATE: Field value is valid according to the date format parameter</li><li>SIZE: Field value length is between min and max parameters</li><li>ENUM: Field value included in ENUM</li><ul/>"
}
}
},
"parameters" : {
"type" : "array",
"title": "Parameters",
"items" : {
"type" : "string",
"title": "Parameter",
"description": "Must be defined for MIN, MAX, DATE or PATTERN constraints (supports EL)",
"description": "Must be defined for MIN, MAX, DATE or PATTERN constraints. (supports EL)",
"x-schema-form": {
"expression-language": true
}
Expand Down

0 comments on commit 2106b08

Please sign in to comment.