@ApiModelProperty example property does not support Map data types
See original GitHub issueWhen the @ApiModelProperty.dataType = “Map”, the JSON output of the example is invalid
For example:
@ApiModelProperty(
value = "IdP-to-SP attributes mapping. A string map of key/value pairs with keys corresponding to IdP attributes as the source " +
"and values corresponding to SP attributes as target. May be omitted or partially-defined to use default mapping.",
example = "{'firstName': 'fname', 'lastName' : 'lname'}",
dataType = "Map[String,String]",
required = false)
public Map<String, String> getAttributeMapping();
Produces:
"attributeMapping": "{'firstName': 'fname', 'lastName' : 'lname'}"
However it should produce:
"attributeMapping": {'firstName': 'fname', 'lastName' : 'lname'}
The attributeMapping field is incorrectly treated like a string and quoted.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
ApiModelProperty example property does not support Map ...
I have a Rest service like : @POST @Path("/{myUrl") @Consumes(MediaType.APPLICATION_JSON) public Response upsertSwitchingInfo(@NotNull ...
Read more >Swagger @ApiParam vs @ApiModelProperty - Baeldung
The @ApiParam annotation is for the parameters of an API resource request, whereas @ApiModelProperty is for properties of the model.
Read more >ApiModelProperty (swagger-annotations 1.5.0 API)
Adds and manipulates data of a model property. ... A sample value for the property. boolean, hidden ... Specifies if the parameter is...
Read more >Generating REST API Documentation with Swagger
Swagger is a framework used for generating RESTful API ... name, data type, example values, and allowed values for the model properties.
Read more >OpenAPI 3 Library for spring-boot
Is based on swagger-ui, to display the OpenAPI description. ... dependency enables the support of spring-boot-starter-data-rest types like: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Follow #1107
Was it solved?