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

Add more parameter validation on type:array #514

Open
chimeno opened this issue Sep 21, 2017 · 3 comments
Open

Add more parameter validation on type:array #514

chimeno opened this issue Sep 21, 2017 · 3 comments

Comments

@chimeno
Copy link

chimeno commented Sep 21, 2017

Description

When using a parameter like:

  dow:
    name: dow
    description: An array of days of the week (0 - 6)
    in: query
    required: true
    type: array
    items:
      type: integer
      minimum: 0
      maximum: 6
      maxItems: 7
      minItems: 1
    collectionFormat: csv

Validation doesn't occur given the properties (minimum, maximum, maxItems, minItems) that are in the https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#itemsObject

Expected behaviour

Validation on that properties should exists

Actual behaviour

Validation doesn't occur

Additional info:

Output of the commands:

  • python: 3.6.1
  • connexion=1.1.15
@mvalkon
Copy link
Collaborator

mvalkon commented Sep 22, 2017

Thanks for reporting this @chimeno .. Would you be willing to provide a fix for this in the form of a PR? If you're not willing, could you provide a more complete example on how to reproduce this?

@dcarrot2
Copy link

It looks like it was added back in #39? However, when I attempt to add minItems to an array type in my swagger.yaml and I run

java -jar ~/swagger-codegen/swagger-codegen-cli-2.2.3.jar generate \
  -i swagger_server/swagger/swagger.yaml \
  -l python-flask \
  -o ./

nothing is generated and my changes to swagger.yaml are reverted.

  • python: 3.6.1
  • connextion: 1.1.9

@roo-oliv
Copy link

roo-oliv commented Dec 7, 2020

This is still present in Connexion 2.7.0. I was trying to use minItems in an array and no validation error is issued when the array does not meet the specification.

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

No branches or pull requests

4 participants