If we can add the swagger file to the local entry instead of adding the
schema, It would avoid by creating multiple entries per API and it is
getting created one entry per API. Then we can create the local entry key
like  api+ resource version so that retrieve the local entry value without
referring to a property from the class mediator.
WDYT?

On Fri, Mar 16, 2018 at 10:58 AM, Nuwan Dias <nuw...@wso2.com> wrote:

> AFAIK we can have rxt fields as optional. Or worst case add fields to the
> rxt on demand, during update. Let’s try and avoid properties since it
> causes data of the same api to be in different places.
>
> On Fri, 16 Mar 2018 at 10:32 am, Megala Uthayakumar <meg...@wso2.com>
> wrote:
>
>> Hi Nuwan/Sanjeewa/APIM Team,
>>
>> Since we need a way to keep track of whether json schema validation is
>> enabled or not for a particular API, shall we go ahead with a regsitry
>> property for this, as we did for publisher access control feature before?
>>
>> If we are going with an attribute, we may need to modify the RXT and
>> there will be a migration for old APIs. What would be the recommended way
>> of doing this?
>>
>> Thanks.
>>
>> Regards,
>> Megala
>>
>> On Thu, Mar 15, 2018 at 10:39 PM, Chamin Dias <cham...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> On Thu, Mar 15, 2018 at 2:44 PM, Sanjeewa Malalgoda <sanje...@wso2.com>
>>> wrote:
>>>
>>>> Hi Sivaramya,
>>>> Its always good to start with complete swagger sample hosted by
>>>> swagger. If you look at APIs deployed here then different paths accept
>>>> different request payloads.
>>>> How are we adding resource accordingly? Is that local entry UUID passed
>>>> to class mediator knows resource specific schema? If so there can be
>>>> multiple entries per API.
>>>>
>>>> Also lets think about cleaning local entries when we disable this.
>>>> Otherwise they will be remain in gateways.
>>>>
>>>> [1]https://github.com/OAI/OpenAPI-Specification/blob/
>>>> master/examples/v2.0/json/petstore-simple.json
>>>>
>>>> Thanks,
>>>> sanjeewa.
>>>>
>>>> On Wed, Mar 14, 2018 at 4:39 PM, Sivaramya Sivanathan <
>>>> sivara...@wso2.com> wrote:
>>>>
>>>>> 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
>>>>>
>>>>> In this situation, will there be many local entries per API? Do we
>>> have any mechanism to handle those kind of scenarios?
>>>
>>> Regards,
>>>>> Sivaramya Sivanathan
>>>>> Associate Software Engineer | WSO2
>>>>> Tel: 0770874960 <077%20087%204960>
>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Sanjeewa Malalgoda*
>>>> WSO2 Inc.
>>>> Mobile : +94713068779 <+94%2071%20306%208779>
>>>>
>>>> <http://sanjeewamalalgoda.blogspot.com/>blog :http://sanjeewamalalgoda.
>>>> blogspot.com/ <http://sanjeewamalalgoda.blogspot.com/>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Architecture mailing list
>>>> Architecture@wso2.org
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>
>>>>
>>>
>>>
>>> --
>>> Chamin Dias
>>> Mobile : 0716097455
>>> Email : cham...@wso2.com
>>> LinkedIn : https://www.linkedin.com/in/chamindias
>>>
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Megala Uthayakumar
>>
>> Senior Software Engineer
>> Mobile : 0779967122
>>
> --
> Nuwan Dias
>
> Software Architect - WSO2, Inc. http://wso2.com
> email : nuw...@wso2.com
> Phone : +94 777 775 729
>
> _______________________________________________
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
*Hasunie Adikari*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
blog http://hasuniea.blogspot.com | https://medium.com/@Hasunie/
Mobile:+94713095876
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to