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
The generator creates a separate type for this definition whenever this parameter is used. If two operations (oper1, oper2) use this parameter, there will be two generated types (Oper1PathParam, Oper2PathParam). This makes it very difficult to handle such parameters in a common middleware, since they cannot be converted to a string, as that is just an underlying type.
The text was updated successfully, but these errors were encountered:
Having a dedicated schema definition that is referenced there is a workaround for this problem. I'm just sure why a separate definition is required in this case.
Although I'm not 100% sure how much inlining the Go compiler does, it may even noticeably reduce the binary size which is something I wanted to explore contributing to ogen when I have time. Parameter reuse was my first idea when looking into the generated code.
Description
Given the following definition:
The generator creates a separate type for this definition whenever this parameter is used. If two operations (oper1, oper2) use this parameter, there will be two generated types (Oper1PathParam, Oper2PathParam). This makes it very difficult to handle such parameters in a common middleware, since they cannot be converted to a string, as that is just an underlying type.
The text was updated successfully, but these errors were encountered: