Closed pablito-perez closed 3 years ago
Hey Pablo, @nomonamo
Totally up to this. That was planned when I first wrote the library back in 2018, but it went by the wayside due to lack of time. Thanks for the contibution, I'm going to review the PR asap.
Fixed in https://github.com/wI2L/fizz/pull/48.
Fizz currently inlines a request's body schema in the operation's definition. When the resulting OpenAPI spec is fed into a code generator such as
openapi-generator
, this produces input types with generic names which are hard to use.I'll illustrate the issue with the following example code:
Before
This server results in the following openAPI schema:
Which in turn, produces the following client code (running
openapi-generator generate -i spec.yaml -g go
):After
A more desirable behaviour would be to generate a named schema for the request body, such as:
Which results in the following generated code: