python-openapi / openapi-core

Openapi-core is a Python library that adds client-side and server-side support for the OpenAPI v3.0 and OpenAPI v3.1 specification.
BSD 3-Clause "New" or "Revised" License
299 stars 133 forks source link

Is there support for deep Object in query params #250

Open Origin1227 opened 4 years ago

Origin1227 commented 4 years ago

Does openapi-core provide support for deep Object in query params Below i have my schema specifying parameters

    parameters
       [
          {
            "name": "abcd",
            "in": "query",
            "description": "Parameters",
            "explode": false,
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "a": {
                  "type": "number"
                },
                "b": {
                  "type": "number"
                }
              }
            }
          }
        ]

example: according to this urls of the type /fruits?abcd[a]=1 should be accepted and urls of type /fruits?abcd=1 should throw error

sarangsbabu367 commented 4 years ago

Related to this issue, Can we validate properties in deepObject schema, I tried with additionalProperties: false. But it wasnt validated. Any value can be given inside deebObject query-param.

p1c2u commented 4 years ago

@sarangsbabu367

Hi, there is no deepObject support at the moment.

https://github.com/p1c2u/openapi-core/blob/0aeb14477bd881247856a8ab520b5adf4223573d/openapi_core/deserializing/parameters/factories.py#L11

Future implementation should validate schema agains schema in schema field.