connexion
connexion copied to clipboard
Add more parameter validation on type:array
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
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?
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
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.