Ruby on Rails supports optional path segments, such as:
would match both photos/:id and photos paths.
However, grape-swagger does not recognise these optional path segments. For example:
would generate:
"paths": {
"/api/v2/photos(/{id})": {
"get": {
...
"parameters": [
{
"in": "path", "name": "id"
...
}
}
instead of the expected:
"paths": {
"/api/v2/photos": {
"get": {
...
}
...
"/api/v2/photos/{id}": {
"get": {
...
"parameters": [
{
"in": "path", "name": "id"
...
}
}
grape-swagger should also handle Rails optional path segments in a predictable manner.
Ruby on Rails supports optional path segments, such as:
would match both
photos/:idandphotospaths.However,
grape-swaggerdoes not recognise these optional path segments. For example:would generate:
instead of the expected:
grape-swaggershould also handle Rails optional path segments in a predictable manner.