Open
Description
kin-openapi (through github.com/oapi-codegen/gin-middleware) and oapi-codegen treat nullable fields differently:
- former wants it to be
nullable: true
- while latter enables optional functionality with skipping property name from
required
list
in result, the openapi component looks like
components:
schemas:
Filter_Active_Opt:
properties:
filter_active:
type: boolean
nullable: true
the field is generated in following way
FilterActive *bool `"json:"filter_active"`
and generated client panics on nil value
panic: reflect: call of reflect.Value.Interface on zero Value
...
github.com/oapi-codegen/runtime/bindform.go:316
well, since the generated server code works fine with just skipping the property from body, and since there's no common way to encode nil
in formdata, I bet this may be skipped in runtime encoder
Metadata
Metadata
Assignees
Labels
No labels