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
Is there a way to generate the model java classes that do not contain the fields and getters/setters for the base class?
For example:
swagger file model:
definitions:
TractPage:
type: objectx-swagger-router-model: com.gotransverse.tract.api.billing.dto.TractPage#x-swagger-router-model: TractPagerequired:
- page_num
- page_sizeproperties:
page_num:
description: The page number of this page of the collectiontype: integerformat: int32example: 1page_size:
description: The page size of this page of the collectiontype: integerformat: int32example: 50num_elements:
description: The number of elements in this page of the collectiontype: integerformat: int32example: 1total_num:
description: The total number of elements in the complete collectiontype: integerformat: int32example: 100links:
description: The list of HATEOAS links for the pagetype: arrayitems:
$ref: '#/definitions/Link'PersonsPage:
description: A page for personx-swagger-router-model: com.gotransverse.tract.api.billing.dto.PersonsPage#x-swagger-router-model: PersonsPageallOf:
- $ref: '#/definitions/TractPage'
- type: objectrequired:
- peopleproperties:
people:
description: The list of people in this pagetype: arrayitems:
$ref: '#/definitions/Person'
The Java classes that get generated look like:
public class Page {
private Integer pageNum = null;
private Integer pageSize = null;
private Integer numElements = null;
private Integer totalNum = null;
private List<Link> links = new ArrayList<Link>();
...
}
public class PersonsPage extends Page {
private Integer pageNum = null;
private List<Link> links = new ArrayList<Link>();
private Integer numElements = null;
private List<Person> people = new ArrayList<Person>();
private Integer pageSize = null;
private Integer totalNum = null;
...
}
The PersonsPage class should not have the fields that are contained in the Page class - at least in the default case.
Is this by design? Or is this a defect?
The text was updated successfully, but these errors were encountered:
And, of course, causes some unpredictable problems as you'd expect when properties are overriden in Java subclasses. This can cause potentially serious bugs.
Is there a way to generate the model java classes that do not contain the fields and getters/setters for the base class?
For example:
swagger file model:
The Java classes that get generated look like:
The PersonsPage class should not have the fields that are contained in the Page class - at least in the default case.
Is this by design? Or is this a defect?
The text was updated successfully, but these errors were encountered: