I have this in my openapi.yaml:
parameters:
- in: query
name: custom_date
required: true
schema:
type: string
format: date
The auto-generated handler fails to return an error if the parameter isn't given in the request. This worked fine before, when we were using version 2.6.0, but it doesn't work on 2.7.1.
I think the bug is in runtime/bindparam.go around line 479. The code looks like this:
if !fieldsPresent {
return nil
}
But it should look like this:
if !fieldsPresent {
if required {
return &RequiredParameterError{ParamName: paramName}
} else {
return nil
}
}
I have this in my openapi.yaml:
The auto-generated handler fails to return an error if the parameter isn't given in the request. This worked fine before, when we were using version 2.6.0, but it doesn't work on 2.7.1.
I think the bug is in
runtime/bindparam.goaround line 479. The code looks like this:But it should look like this: