Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sloory opened this issue May 13, 2022 · 0 comments · May be fixed by #168
Open

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

sloory opened this issue May 13, 2022 · 0 comments · May be fixed by #168

Comments

@sloory
Copy link

sloory commented May 13, 2022

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant