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

Parameter 'style' has incorrect value 'undefined' #473

Closed
laur4c opened this issue Nov 27, 2020 · 2 comments
Closed

Parameter 'style' has incorrect value 'undefined' #473

laur4c opened this issue Nov 27, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@laur4c
Copy link

laur4c commented Nov 27, 2020

Hello,

It seems like the style parameter is required but this keywork has form as default value
https://swagger.io/docs/specification/serialization/#query

Why it's required and the validation fail instead of using the spec default value?

E.g:

While trying to use the following JSON schema to define a query parameter:

{
  "description":"Description",
  "required":false,
  "schema":{
    "title":"State",
    "type":"array",
    "items":{
      "$ref":"#/components/schemas/ThreadState"
    },
    "description":"A description"
  },
  "name":"state",
  "in":"query"
}

I get the error:

{
    "message": "Parameter 'style' has incorrect value 'undefined' for [state]",
    "errors": [
        {
            "path": ".query.state",
            "message": "Parameter 'style' has incorrect value 'undefined' for [state]"
        }
    ]
}

Any thoughts? Maybe I'm missing something

Thanks!

cdimascio added a commit that referenced this issue Nov 28, 2020
@cdimascio cdimascio added the bug Something isn't working label Nov 28, 2020
@cdimascio
Copy link
Owner

thanks for the issue @laur4c. it is fixed in v4.7.2

@laur4c
Copy link
Author

laur4c commented Nov 28, 2020

Thanks for the fix!

ex1st pushed a commit to ex1st/express-openapi-validator that referenced this issue Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants