You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/15 11:57:44 UTC

[GitHub] [apisix] imjoey opened a new issue #2432: bug: incorrect json schema definition for plugin request-validation

imjoey opened a new issue #2432:
URL: https://github.com/apache/apisix/issues/2432


   Part of #2082 .
   
   Current request-validation schema definition is shown as below:
   
   ```json
   {
       "anyOf": [
           {
               "required": [
                   "body_schema"
               ]
           }, 
           {
               "required": [
                   "header_schema"
               ]
           }
       ], 
       "properties": {
           "body_schema": {
               "type": "object"
           }, 
           "header_schema": {
               "type": "object"
           }
       }, 
       "type": "object"
   }
   ```
   
   The definition should be changed to:
   
   ```json
   {
       "anyOf":[
           {
   	    "title": "Body schema",
               "properties":{
                   "body_schema":{
                       "type":"object"
                   }
               },
               "required":[
                   "body_schema"
               ]
           },
           {
   	    "title": "Header schema",
               "properties":{
                   "header_schema":{
                       "type":"object"
                   }
               },
               "required":[
                   "header_schema"
               ]
           }
       ],
       "type": "object"
   }
   ```
   
   **BTW**:
   Honestly, after the schema has been updated, we are still not be able to input anything for `header_schema` and `body_schema` fields. See the snapshot below:
   
   ![image](https://user-images.githubusercontent.com/2542401/96113795-43bc2400-0f17-11eb-8a01-0dc1aeea7455.png)
   
   The reason is that both `body_schema` and `header_schema` are of `object` type without any `properties` defined, while the react-jsonschema-form library will not show any input fields for them. I tried to refer to https://react-jsonschema-form.readthedocs.io/en/v1.8.1/form-customization/ , unfortunately there seems no way to make use of `uiSchema` to solve this problem.
   
   After discussed with @liuxiran , in order to make it happen that we could define the schema on the web, we also need to customize the dashboard UI, as well as well design the `header_schema` and `body_schema` data structures submitted to APISIX. That could be committed to dashboard project following this issue got fixed.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] imjoey commented on issue #2432: bug: incorrect json schema definition for plugin request-validation

Posted by GitBox <gi...@apache.org>.
imjoey commented on issue #2432:
URL: https://github.com/apache/apisix/issues/2432#issuecomment-709272825


   @juzhiyuan @liuxiran  Please see https://bjdash.github.io/JSON-Schema-Builder/ that may be a good choice for online json schema designers. 😄 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] fukiki commented on issue #2432: bug: incorrect json schema definition for plugin request-validation

Posted by GitBox <gi...@apache.org>.
fukiki commented on issue #2432:
URL: https://github.com/apache/apisix/issues/2432#issuecomment-709703582


   @juzhiyuan  @membphis @liuxiran Please assign to me.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis closed issue #2432: bug: incorrect json schema definition for plugin request-validation

Posted by GitBox <gi...@apache.org>.
membphis closed issue #2432:
URL: https://github.com/apache/apisix/issues/2432


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] juzhiyuan commented on issue #2432: bug: incorrect json schema definition for plugin request-validation

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2432:
URL: https://github.com/apache/apisix/issues/2432#issuecomment-709292060


   ok then, @membphis Please take a look at this new schema


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org