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
{{ message }}
Repository navigation
Generate simply named, reusable model objects from simple form of $ref to an external yaml file #291
The generator would generate a BarResponse[DTO].java file, using the filename to drive the class name. Switching to openapi-processor, the same yaml generates a computed name such as FooGetResponse200[DTO].java.
This can be fixed by updating BarResponse.yaml to add the first 3 lines (and fix indentation):
responses:
'200':
description: OK
content:
'application/json':
schema:
$ref: './components/schemas/bar/BarResponse.yaml#/components/schemas/BarResponse'
solves the issue, with the generated model back to BarResponse[DTO].java.
Feature request is to leverage the external filename to determine the model name to bring feature parity with the openapi-generator. I'm not exactly sure if one of the two external file formats is officially correct and the other not, but it is less verbose to be able to use the shorter notation.
Activity
tedberg commentedon Aug 14, 2025
This is similar to #189, but that issue is talking about inline definitions.
hauner commentedon Aug 14, 2025
Sounds reasonable, will be interesting to see how easy it is to get at the filename. :-)
add integration test (#291)
extract/improve name from ref creation (#291)
remove duplication (#291)
fix $ref (#291)
activate integration test (#291)
clean up (#291)