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

"This API version doesn't seem to exist" #21

Closed
alexwhitman opened this issue Nov 19, 2014 · 3 comments
Closed

"This API version doesn't seem to exist" #21

alexwhitman opened this issue Nov 19, 2014 · 3 comments

Comments

@alexwhitman
Copy link
Contributor

Below is an api definition that we're using:

{
    "name": "API",
    "api_id": "1",
    "org_id": "default",
    "definition": {
        "location": "header",
        "key": "version"
    },
    "auth": {
        "auth_header_name": "authorization"
    },
    "version_data": {
        "not_versioned": true
    },
    "proxy": {
        "listen_path": "/",
        "target_url": "http://backend:8000",
        "strip_listen_path": true
    }
}

version_data.not_versioned is set to true but hitting any route in that API returns

{
    "error": "This API version doesn't seem to exist"
}

This is running on a build of current master.

Also notice that the single quote in the string has been HTML encoded, that probably shouldn't happen. 😄

@lonelycode
Copy link
Member

I think I may know what's wrong here, the version_data section still requires the ignored, blaklist and whitelist metadata. In a non-versioned API Tyk uses a "Default" version (the first in the list). So if you add a single version entry with empty values it should behave itself:

{
    "name": "API",
    "api_id": "1",
    "org_id": "default",
    "definition": {
        "location": "header",
        "key": "version"
    },
    "auth": {
        "auth_header_name": "authorization"
    },
    "version_data": {
        "not_versioned": true,
        "versions": {
            "default": {
                "name": "default",
                "expires": "",
                "paths": {
                    "ignored": [],
                    "white_list": [],
                    "black_list": []
                }
            }
        }
    },
    "proxy": {
        "listen_path": "/",
        "target_url": "http://backend:8000",
        "strip_listen_path": true
    }
}

Will fix the HTML encoding, that'a a little odd...

@alexwhitman
Copy link
Contributor Author

That's done it, thanks.

@lonelycode
Copy link
Member

Fixed HTML encoding... not ideal, but fixed, still pondering if we should switch out from HTML templates instead of text.

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