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

[BUG] String type parameter in post request body was generated as Java class type #175

Closed
simonsonzhang opened this issue Dec 13, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@simonsonzhang
Copy link

used cli to create a client sdk jar file: java -jar openapi-generator-cli-5.0.0-beta3.jar generate --input-spec synopsys-coverity-coverity-connect-2020.12-resolved.yaml -g java -o connectAPIclient-2020.12 .

in the swagger yaml file, two String parameters (FilterKey and FilterMatchMode )were defined in the post request body. the only difference is FilterMatchMode is a enum string, it only allows two values ("oneOrMoreMatch" or "noneMatch"), but in the auto Generated java code, the FilterKey was generated as a string type, but FilterMatchMode was generated as a FilterMatchMode class type, both should be generated as String type.

Swagger definition:
`

FilterKey string

FilterMatchMode string
values:
oneOrMoreMatch: (Default) At least one of the values must match the item.
noneMatch: None of the values may match the item.
Enum:[ oneOrMoreMatch, noneMatch ]

Auto generated JAVA code:  @javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-12-12T03:14:15.736Z[GMT]")
public class FilterElement {
@SerializedName("filterKey")
private String filterKey = null;

@SerializedName("matchMode")
private FilterMatchMode matchMode = null;
`

@simonsonzhang simonsonzhang added the bug Something isn't working label Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants