You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I deprecate a field in Go, I would like the field to marked as deprecated in the OpenAPI specification. This will allow users of my OpenAPI spec to be aware of which fields they should avoid.
Scenario
I have the following struct defined in Go:
typeExampleStructstruct {
// NewField is the field that should be used.NewFieldstring// OldField is the field that used to be used.// Deprecated: Use NewField instead.OldFieldstring
}
Expected
This would create a model in the OpenAPI specification such as:
ExampleStruct:
type: objectproperties:
NewField:
description: NewField is the field that should be used.type: stringOldField:
deprecated: truedescription: |- OldField is the field that used to be used. Deprecated: Use NewField instead.type: stringrequired:
- NewField
- OldField
Note that OldField is marked as deprecated.
Actual
The model is created without any deprecation flag i.e.:
ExampleStruct:
type: objectproperties:
NewField:
description: NewField is the field that should be used.type: stringOldField:
description: |- OldField is the field that used to be used. Deprecated: Use NewField instead.type: stringrequired:
- NewField
- OldField
The text was updated successfully, but these errors were encountered:
Background
If I deprecate a field in Go, I would like the field to marked as deprecated in the OpenAPI specification. This will allow users of my OpenAPI spec to be aware of which fields they should avoid.
Scenario
I have the following struct defined in Go:
Expected
This would create a model in the OpenAPI specification such as:
Note that
OldField
is marked as deprecated.Actual
The model is created without any deprecation flag i.e.:
The text was updated successfully, but these errors were encountered: