swaggest / openapi-go

OpenAPI structures for Go
https://pkg.go.dev/github.com/swaggest/openapi-go/openapi3
MIT License
259 stars 23 forks source link

Ignore json tags if formData is present in request body structure #47

Closed cussrox closed 2 years ago

cussrox commented 2 years ago

Currently, if both types of tags are defined on fields, schemas for both formData and json will be create with separate content types. This not a commonly desired outcome as usually only one type is needed, while json can also be defined for other needs.

This PR adds a check to ignore json in such case, also it adds a lebeling interface to restore original behavior for edge cases.