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] [JAVA]String type parameter in post request body was generated as Java class type #8184

Open
simonsonzhang opened this issue Dec 14, 2020 · 2 comments

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;
`

@auto-labeler
Copy link

auto-labeler bot commented Dec 14, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@GORA-SAG
Copy link
Contributor

Hi @simonsonzhang is it possible to attach the swagger definition.

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

No branches or pull requests

2 participants