-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I have found an issue while creating an OpenAPI definition with this library.
I define my operation responses as:
responses {
response("204") {
description = "..."
}
responses.putAll(standardResponses)
}Where standardResponses is a collection of common responses. The responses method is a builder for ApiResponses class from swagger that implement LinkedHashMap so the order should be preserved.
Everything should work but the output does not keep the same order I used while inserting the responses, the cuprit seems to be the JSONObject used for formatting:
| internal fun validatedJson(api: OpenAPI): JSONObject { | |
| val json = Json.mapper().writeValueAsString(api) | |
| OpenAPIV3Parser().read(toFile(json).absolutePath) | |
| return JSONObject(json) | |
| } |
Looks like there is a debate about this problem at the moment, see issue
Metadata
Metadata
Assignees
Labels
No labels