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

Default Value not getting assigned to the variable in generated typescript #9881

Open
gpadbidri opened this issue Apr 26, 2024 · 0 comments
Open

Comments

@gpadbidri
Copy link

I am using io.swagger.v3.oas.annotations namespace in my Soring Boot application to generate Swagger documentation.

This is my POJO :
@DaTa
@AllArgsConstructor
@Schema(name="CustomPojoDTO")
public class CustomPojo {

@Schema(description = "Type representing the node", defaultValue = "ADD_TO_LIST", type = "string", example="ADD_TO_LIST")
@Parameter(schema = @Schema(type = "string", defaultValue = "ADD_TO_LIST"))
@JsonProperty("type") // Map the JSON property to Java property
private String type = "ADD_TO_LIST"; // Default value ADD_TO_LIST

}

Genreated ts contains :

/**

  • Action Type representing the node
  • @default "LIST_NODE"
  • @example "LIST_NODE"
    */
    type ?: string;

However I want to assign the value LIST_NODE as the default value. It fails. What can be done to achieve this ? Please let me know. Thanks !

Swagger displays it this way :

image

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

No branches or pull requests

1 participant