Forum Discussion

YuriFedorov's avatar
YuriFedorov
New Contributor
3 years ago

Question about Swager3


if I write in the controller the maximum length of the enam , then  the drop-down list disappears

@Operation(description = "..........")
public ResponseEntity<...........> nameMethod(
@Parameter(description = "someType", schema = @Schema(maxLength = 13), required = true)
@PathVariable("namePathVariable") Enum enum,

no dropdown list

 

and if

@Operation(description = "..........")
public ResponseEntity<...........> nameMethod(
@Parameter(description = "someType",  required = true)
@PathVariable("namePathVariable") Enum enum,

 

 there is a drop-down list

 

Tell me plis what is the matter and is there an option to get a drop-down list and write the limitation of maxLength on the length of the enam?

 

Thanks a lot!

2 Replies

  • Hi YuriFedorov,

     

    For the drop down list that's missing, is it missing from an OpenAPI document rendered in SwaggerUI?

     

    Also, could you possibly post snippets from the OpenAPI document created that relates to these functions? I'm unfamiliar with Spring, but if we could look at the YAML or JSON file for the API definition it may give us some insight at to what is going on.

    • YuriFedorov's avatar
      YuriFedorov
      New Contributor

       Thanks a lot! The question was resolved by allowing to do without the maxLength parameter for enumerations.