-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
I would like to be able to validate manifests targeting our local k8s cluster. There are invariably CRDs in these manifests. I'm fetching the complete openapi spec from the cluster like this:
curl -o openapi.json -H 'Authorization: Bearer ...' https://api.cluster.example.com:6443/openapi/v2
And then attempting to convert these into json schemas like this:
openapi2jsonschema openapi.json --expanded --kubernetes --strict
This fails with:
Generating shared definitions
Traceback (most recent call last):
File "/home/lars/.local/bin/openapi2jsonschema", line 8, in <module>
sys.exit(default())
File "/home/lars/.local/pipx/venvs/openapi2jsonschema/lib64/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/lars/.local/pipx/venvs/openapi2jsonschema/lib64/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/lars/.local/pipx/venvs/openapi2jsonschema/lib64/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/lars/.local/pipx/venvs/openapi2jsonschema/lib64/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/lars/.local/pipx/venvs/openapi2jsonschema/lib64/python3.9/site-packages/openapi2jsonschema/command.py", line 99, in default
if expanded and "apiVersion" in type_def["properties"]:
KeyError: 'properties'
I've attached the openapi spec to this issue.
Metadata
Metadata
Assignees
Labels
No labels