UUID parameters don't have format "uuid"
See original GitHub issueI’m using springfox 2.8.0.
The following piece of code:
@RestController
public class NotificationApi {
@ApiOperation(nickname = "markNotificationDelivered", value = "Mark a notification as delivered.")
@RequestMapping(path = "notifications/{id}/delivered", method = RequestMethod.POST)
void markNotificationDelivered(@PathVariable("id") UUID id) {
}
}
is converted to:
"/notifications/{id}/delivered" : {
"post" : {
"tags" : [ "notification-api" ],
"summary" : "Mark a notification as delivered.",
"operationId" : "markNotificationDelivered",
"schemes" : [ ],
"consumes" : [ "application/json" ],
"produces" : [ "*/*" ],
"parameters" : [ {
"name" : "id",
"in" : "path",
"description" : "",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "OK",
"examples" : { },
"headers" : { }
}
},
"security" : [ ]
}
}
The problem is that parameter id
doesn’t have "format": "uuid"
set. When I annotate the parameter with @ApiParam(format = "uuid") @PathVariable("id")
, there is still no format
in the Swaggerfile.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How to define UUID property in JSON Schema and Open API ...
Primitives have an optional modifier property: format . OAS uses several known formats to define in fine detail the data type being used....
Read more >Guide to UUID in Java - Baeldung
A quick and practical introduction to UUID in Java. ... The UUID class has a single constructor that requires two long parameters describing ......
Read more >'String' is not convertible to type/format 'String/uuid'
I have tried adding the expression guid() in front of the field in the Flow and still get this error. The 'inputs.parameters' of...
Read more >Why is java.util.UUID.randomUUID not accepted as a parameter
I have the following function definition: def testGenerateUuids(name: String, uuidFn: () => String, repeats: Int, iterations: Int) { When I call this with:...
Read more >Universally unique identifier - Wikipedia
Thus, anyone can create a UUID and use it to identify something with near certainty that the identifier does not duplicate one that...
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
I managed to hotfix this with plugins:
That would be an issue for Swagger-ui