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

Incompatibility with python 3 and open local file instead of url #6

Closed
jcketz opened this issue Nov 22, 2017 · 2 comments
Closed

Incompatibility with python 3 and open local file instead of url #6

jcketz opened this issue Nov 22, 2017 · 2 comments

Comments

@jcketz
Copy link

jcketz commented Nov 22, 2017

Hi, thanks for your work, but I faced few problems:
Your code is Incompatible with python and you can't load a local file : here are the modifications for python3 compatibility and local file choice

import urllib
from urllib.request import Request, urlopen
...
    info("Downloading schema")
    if (urllib.parse.urlparse(schema).scheme != ""):
        req = Request(schema,headers={'User-Agent': 'Mozilla/5.0'})
        response = urllib.request.urlopen(req)
    else:
        response  = open(schema, "r")
    info("Parsing schema")
...
@consideRatio
Copy link

Dang - same for me, thanks for providing code @jcketz !

@garethr kubeval made me very happy recently by finding previously silent failures in --strict mode. But when used with kubernetes 1.10.4 or 1.9+ really the strict mode was lacking so I hoped to use these tools to get a schema and perhaps make a PR, but then I ran into this instead!

@garethr
Copy link
Collaborator

garethr commented Aug 25, 2018

This should be fixed in master now.

@garethr garethr closed this as completed Aug 25, 2018
lirik90 pushed a commit to lirik90/swagger2jsonschema that referenced this issue Mar 30, 2024
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

3 participants