Skip to content

Extraction of Schema from K8S 1.12.2 Spec fails with UnboundLocalError #16

Description

@dneuhaeuser-zalando

When extracting the JSON schema from the Kubernetes 1.12.2 spec I get an UnboundLocalError exception:

$ openapi2jsonschema -o src/zkubelnt/schemas/kubernetes-json-schema/master/v1.12.2-standalone-strict --kubernetes --stand-alone --strict https://raw.githubusercontent.com/kubernetes/kubernetes/v1.12.2/api/openapi-spec/swagger.json
Downloading schema
Parsing schema
Traceback (most recent call last):
  File "/Users/dneuhaeuser/.pyenv/versions/zkubelnt-schema/bin/openapi2jsonschema", line 11, in <module>
    sys.exit(default())
  File "/Users/dneuhaeuser/.pyenv/versions/3.6.4/envs/zkubelnt-schema/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/dneuhaeuser/.pyenv/versions/3.6.4/envs/zkubelnt-schema/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/dneuhaeuser/.pyenv/versions/3.6.4/envs/zkubelnt-schema/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/dneuhaeuser/.pyenv/versions/3.6.4/envs/zkubelnt-schema/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/dneuhaeuser/.pyenv/versions/3.6.4/envs/zkubelnt-schema/lib/python2.7/site-packages/openapi2jsonschema/command.py", line 158, in default
    if version < '3':
UnboundLocalError: local variable 'version' referenced before assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions