Closed lsdch closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.77%. Comparing base (
e1b7179
) to head (43dc637
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@lsdch this is a good idea but I didn't add this because of the following scenario:
type MyBody struct {
Field string `json:"field"`
}
type Response1 struct {
Body MyBody `additionalProperties:"true"`
}
type Response2 struct {
Body MyBody `additionalProperties:"false"`
}
How would you generate the OpenAPI spec for this? In JSON Schema the additionalProperties
field is a property of the object
schema rather than on the individual properties within some object. You could use allOf
to combine the object definition with additionalProperties
, but that has pretty undesirable effects for code generated SDKs.
@danielgtaylor ah yes, totally agree thanks for pointing this out. Closing!
This is a small QoL improvement that allows toggling the
additionalProperties
attribute on a request body, without having to modify the body struct type.Usage :