Hi all,

Currently, I'm working on the Json Schema Validation for API manager. When
we execute a API request,  we need to do the Json schema validation so that
we can reduce the backend failures and also we can protect the gateways.
For this feature the proposed method is as follows,

   -

   Add the Json schema to the swagger file as mentioned below, so that we
   can validate the request using the swagger file.

*"parameters": [*

*          {*

*            "name": "Product",*

*            "description": "A product from the catalog",*

*            "required": false,*

*            "in": "body",*

*            "schema": {*

*              "type": "object",*

*              "properties": {*

*                "id": {*

*                  "type": "number",*

*      “Description”: “The unique identifier for a product”*

*                },*

*    "name": {*

*                  "type": "string",*

*      “Description”: “Name of the product”*

*                },*

* "price": {*

*                  "type": "number",*

*      “minimum”: 0*

*              }*

*            }*

*          }*

*        ],*


   - Add a new check-box to enable the json-schema in UI in the publisher
   level.
   - If check-box enabled, at the point of generating API synapse
   configuration, we can add the schema to a local entry which the name of the
   local entry will be UUID + api+ resource version.
   - We can add a property to hold the local entry name related with UUID
   and add a class mediator inside each resource definition.
   - Class mediator should make use of that property to get the schema

Regards,
Sivaramya Sivanathan
Associate Software Engineer | WSO2
Tel: 0770874960
WSO2 Inc : http://wso2.org
<http://www.google.com/url?q=http%3A%2F%2Fwso2.org&sa=D&sntz=1&usg=AFQjCNE_eTDfyl2ibPcq0hcXvRDNVuQmMg>
LinkedIn | www.linkedin.com/in/sivaramya
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to