Open shockey opened 5 years ago
I do have also a problem with generating the class name with Swagger-codegen 3.0.5. In my case I have different folders for parameter and definitions. When I'd like to address the $ref from another folder it is combining the full path of the $ref as class attribute:
swagger.yml:
openapi: 3.0.0
...
/alerts/query:
post:
...
requestBody:
$ref: ./parameters/alerts.yml#/AlertsQueryParameter
...
parameters/alerts.yml:
AlertsQueryParameter:
name: alertQueryPayload
content:
application/json:
schema:
$ref: ./definitions/alerts.yml#/AlertsQuery
...
definitions/alerts.yml:
AlertsQuery:
type: object
properties:
pageable:
$ref: "./app.yml#/Pageable"
...
definitions/app.yml:
Pageable:
type: object
properties:
pageNumber:
type: integer
format: int64
pageSize:
type: integer
format: int64
sortingInstructions:
type: array
items:
$ref: '#/SortingInstruction'
required:
- pageNumber
- pageSize
- sorts
The name of the class should be Pageable
but it is creating DefinitionsappYmlPageable
@shockey, I'm also facing the similar issue when using swagger-codegen 3.x. Is there any way to overcome this? Compilation Error in the generated code when there is reference in the format:
$ref: '#/components/schemas/entry'
In the generated service code, it imports a class called ComponentsSchemasEntryModel
which makes the compilation error.
I am using swagger-codegen-maven-plugin
version 3.0.19
with language jaxrs-cxf-cdi
From @noha-gamal on February 12, 2019 13:56
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
Bug is in class EligibleProductOfferingVBOProductOffering.java get id attribute private List id = null;
where class BasicComponentspropertiesIDType not found.
expected attribute id with type BasicComponentsIDType
To reproduce...
Steps to reproduce the behavior:
Expected behavior
expected that id attribute in EligibleProductOfferingVBOProductOffering.java be private List id = null;
instead of
private List id = null;
Copied from original issue: swagger-api/swagger-ui#5175