Orange-OpenSource / angular-swagger-ui

An angularJS implementation of Swagger UI
http://orange-opensource.github.io/angular-swagger-ui/
MIT License
135 stars 74 forks source link

UI Not representing JaxRS @Path when it includes regex #76

Closed peterberkman closed 7 years ago

peterberkman commented 7 years ago

This is one example and the UI simply display {id} without the preceeding slash and the "Try It!" button fails regardless of what is entered in the "optional" path parameter:

@Path("/set/{id : (/id)?}")

in the UI:

/xxxx/set/{id}

and when the "Try It!" button is pressed:

Response headers
{
  "date": "Sat, 27 May 2017 03:42:47 GMT",
  "cache-control": "no-cache",
  "server": "Jetty(9.3.14.v20161028)",
  "content-length": "0",
  "allow": "DELETE,POST,GET,PUT,OPTIONS,HEAD"
}
mathieuales commented 7 years ago

Hi ! You're right, i'll have a look at it asap !

mathieuales commented 7 years ago

i'm finally not sure the issue is coming from angular-swagger-ui, could you please send the generated swagger.json ?

peterberkman commented 7 years ago

unfortunately, it might take me a bit. I've redone my paths so they work (just added new methods). I'll try and put one back and generate.

peterberkman commented 7 years ago

Mathieuales, sorry this took so long! I added the following:

@Path("/definitionstest{structure : (/structure)?}")

with this result (also in attached zip):

"/codeset/definitionstest{structure}": {
"get": {
"tags": [
"Codeset Manager"
],
"summary": "Retrieve the response structure definition(s) supplied to/from Codeset Manager",
"description": "",
"operationId": "getDefinitionsTest_1",
"produces": [
"application/json"
],
"parameters": [
{
"name": "structure",
"in": "path",
"description": "The structure name ('All'=all structures)",
"required": true,
"type": "string",
"pattern": "(/structure)?",
"enum": [
"All",
"AssigningAuthority",
"CodeSet",
"Code"
]
}
],
"responses": {
"200": {
"description": "The operation was successful",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/FieldDefinitionType"
}
},
"headers": {
"X-Count": {
"type": "integer",
"format": "int32",
"description": "The total entries in list"
}
}
},
"404": {
"description": "Invalid structure name supplied"
}
},
"security": [
{
"ngsAuthProvider": [
"any"
]
}
]
}
},

swagger-regex-test.zip