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
Do you support generating spec from code? I see parsing, validation, generating servers client etc but not sure if code to spec is supported here. General usecase is similar to the one that goswagger supports here: https://goswagger.io/generate/spec.html (doesnt support openapi 3, 3.1 and json schema)
Basically: annotate actual go structs with some comments or tags (like jsonschema tags) and get a schema doc (yaml or json) out, then use that schema doc using the libraries in this repo to validate and decode incoming requests to the same structs. This way source of truth remains go code only and openapi serves as a IDL and consistent contract definition.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Do you support generating spec from code? I see parsing, validation, generating servers client etc but not sure if code to spec is supported here. General usecase is similar to the one that goswagger supports here: https://goswagger.io/generate/spec.html (doesnt support openapi 3, 3.1 and json schema)
Basically: annotate actual go structs with some comments or tags (like jsonschema tags) and get a schema doc (yaml or json) out, then use that schema doc using the libraries in this repo to validate and decode incoming requests to the same structs. This way source of truth remains go code only and openapi serves as a IDL and consistent contract definition.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions