Skip to content

In case of specified oneOf property in parameters library does not find suitable #166

@sloory

Description

@sloory

When validating a request using an OpenAPI specification that contains a Parameter definition as in this example:

        parameters:
            - in: query
              name: filter
              style: deepObject
              allowReserved: true
              schema:
                type: object
                properties:
                  filters:
                    oneOf:
                        -
                            type: object
                            required:
                              - max
                            properties:
                              max:
                                type: number
                        -
                            type: object
                            required:
                              - min
                            properties:
                              min:
                                type: number

and we pass correct query parameter value: filter[filters][min]=1 library does not try choose suitable variant under oneOf and return error:

1) League\OpenAPIValidation\Tests\FromCommunity\Issue222Test::testIssue140
League\OpenAPIValidation\PSR7\Exception\Validation\InvalidQueryArgs: Value "{
    "filters": {
        "min": "1"
    }
}" for argument "filter" is invalid for Request [get /list]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions