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

Generate from a local file schema #19

Open
nikolay opened this issue Dec 24, 2018 · 2 comments
Open

Generate from a local file schema #19

nikolay opened this issue Dec 24, 2018 · 2 comments

Comments

@nikolay
Copy link

nikolay commented Dec 24, 2018

Using the file: protocol doesn't seem to work. It errors out like this:

FATA[0000] generate lib                                  error="import Kubernetes spec: load schema from path: Get http://localhost:8001/swagger.json: dial tcp [::1]:8001: connect: connection refused"
@nikolay
Copy link
Author

nikolay commented Dec 24, 2018

Doesn't seem to work with remote ether:

The snippet:

local -r schema="https://raw.githubusercontent.com/kubernetes/kubernetes/v${kubernetes_version}/api/openapi-spec/swagger.json"
pushd "${schema_dir}"
rm -rf "${schema_dir}"
mkdir -p "${schema_dir}"
openapi2jsonschema \
    --kubernetes \
    --stand-alone \
    "${schema}"
popd

returns tons of:

Processing storageclasslist
An error occured processing storageclasslist: URLError: <urlopen error [Errno 21] Is a directory: '/Users/.../schema/schemas/'>

with a lot of empty (0-byte) schema files.

@poutysquire10
Copy link

to use local file you must use file protocol:
file:///AbsolutePath

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