grape-swagger
grape-swagger copied to clipboard
Does Not Handle Rails Optional Path Segments
Ruby on Rails supports optional path segments, such as:
get 'photos(/:id)'
would match both photos/:id and photos paths.
However, grape-swagger does not recognise these optional path segments. For example:
get 'photos(/:id)'
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.