Handling of default values in query parameters
emilien-puget opened this issue · 4 comments
emilien-puget commented
First of all, i love what you did there.
What do you think about handling default values in query parameters ?
daveshanley commented
Could you help me understand a little more?
emilien-puget commented
in a open api specification, a default value can be specified like so
name: "page"
in: "query"
style: "deepObject"
required: false
schema:
type: object
properties:
size:
type: integer
minimum: 1
maximum: 50
default: 20
require: false
Right now we would reject an http query with size
not set because it violates the schema, but a default value is set.
daveshanley commented
Oh, yes! of course. I forgot about that. We should absolutely add support to the validators.
emilien-puget commented
after some deliberation, i think we should not do that, as this suggestion would mean that we modify the request, and we should keep the responsibility of this library to validate request