Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with parentheses ( ) in swagger endpoint #34

Closed
leon-vg opened this issue Jul 5, 2018 · 1 comment
Closed

issue with parentheses ( ) in swagger endpoint #34

leon-vg opened this issue Jul 5, 2018 · 1 comment

Comments

@leon-vg
Copy link

leon-vg commented Jul 5, 2018

With odata-based services, it is common to have endpoints with the following character:

/entity('A123')

I have made swagger documentation for this endpoint, but RESTinstance gives an incorrect error that this path is not found:

test                                                                | FAIL |
u'request':
    - 'path':
        - "No paths found for /entity('A123')"

I am under the impression that this has to do with the fact that the endpoint contains parentheses.

Here follows an example to reproduce this problem:

Swagger documentation: api-docs.json

{
    "info": {
        "title": "Test API",
        "version": "1"
    },
    "basePath": "/api/v1",
    "swagger": "2.0",
    "paths": {
        "/entity('{name}')": {
            "get": {
                "summary": "get odata endpoint",
                "parameters": [
                    {
                        "in": "path",
                        "name": "name",
                        "type": "string",
                        "required": true,
                        "description": "Name"
                    }
                ],
                "produces": [
                    "application/json"
                ],
                "responses": {
                    "200": {
                        "description": "success"
                    }
                }
            }
        }
    },
    "definitions": {},
    "responses": {},
    "parameters": {},
    "securityDefinitions": {}
}

Robot Framework test

*** Settings ***
Library  REST  url=https://host/  spec=./api-docs.json

*** Test Cases ***
test
    REST.Get  /api/v1/entity('A123')
@leon-vg
Copy link
Author

leon-vg commented Jul 5, 2018

I think I tracked down the issue. It is in the 'flex' library:
pipermerriam/flex#204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants