-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Hello,
I have this description
@OpenAPIDefinition(
info = @Info(
title = "My Rest API",
version = "1.0.0",
description = "My RESTful API implementation"
),
servers = {
@Server(
description = "My REST API",
url = "/{context-path}/{rest-api}",
variables = {
@ServerVariable(name = "context-path", defaultValue = "my-war"),
@ServerVariable(name = "rest-api", defaultValue = "api", allowableValues = {"api", "rest", "batchapi"})
}
)
}
)
I use the swagger-maven-plugin
version 2.0.6 to generate the JSON in open api 3.0 format.
I obtain this JSON
"servers" : [ {
"url" : "/{context-path}/{rest-api}",
"description" : "My REST API",
"variables" : {
"context-path" : {
"default" : "my-war",
"enum" : [ "" ]
},
"rest-api" : {
"default" : "api",
"enum" : [ "api", "rest", "batchapi" ]
}
}
} ],
The problem is the empty "enum" : [ "" ]
that in the swagger-ui is rendered as an empty dropdown. Without the empty enum there is an input field with the default value so it is possible to set a different context path.
Is there please a workaround?
Metadata
Metadata
Assignees
Labels
No labels