Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server stub in spring from swagger yaml #9996

Closed
rehaanhaiderre opened this issue Jan 20, 2020 · 1 comment · Fixed by #10377
Closed

Server stub in spring from swagger yaml #9996

rehaanhaiderre opened this issue Jan 20, 2020 · 1 comment · Fixed by #10377
Milestone

Comments

@rehaanhaiderre
Copy link

rehaanhaiderre commented Jan 20, 2020

I am using spring server stub from swagger yaml to generate POJO classes. In my definition, I am having allOf keyword for image property of the Images model. But, the stub generated does not have the correct class reference. It is generating with Object class instead of the type Image class. What is the mistake I am doing here? This is my swagger yaml.

.......................................................................................................................................
Images:
title: images
type: object
description: A collection of still images related to the work
properties:
images:
type: object
#items:
allOf:
- $ref: '#/components/schemas/Image'
videos:
type: array
items:
$ref: '#/components/schemas/Video'
...........................................................................................................................
This is the generated POJO class of Images
..........................................................................................................................
public class Images {
@JsonProperty("images")
private Object images = null;

 @JsonProperty("videos")
 @Valid
 private List<Video> videos = null;

 public Images images(Object images) {
    this.images = images;
    return this;
 }

}
.............................................................................................................................
Why is the type Object and not of Image?

@HugoMario
Copy link
Contributor

fixed with swagger-codegen-generators#628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants