Skip to content

Conversation

@squaremo
Copy link
Member

@squaremo squaremo commented Mar 17, 2020

The tool that generates the schemas in use here,
https://github.com/instrumenta/openapi2jsonschema, shortens group
names for Kubernetes definitions to just the first segment -- e.g.,
apiextensions.k8s.io gets the group apiextensions. The group is
then used to name the schema file generated.

This commit reproduces that logic in the schema.js, so that it can
find the right file for resources that have a dotted name as above.

Fixes #69.

@squaremo squaremo force-pushed the truncate-group branch 3 times, most recently from d4744bc to d2c192b Compare March 18, 2020 08:02
The tool that generates the schemas in use here,
https://github.com/instrumenta/openapi2jsonschema, shortens group
names for Kubernetes definitions to just the first segment -- e.g.,
`apiextensions.k8s.io` gets the group `apiextensions`. The group is
then used to name the schema file generated.

This commit reproduces that logic in schema.js, so that it can find
the right file for resources that have a dotted name as above.

To be able to test the path construction in isolation, I moved things
around a little, so access to resources is done from validate.js.
@squaremo squaremo merged commit c13dbd7 into master Mar 18, 2020
@squaremo squaremo deleted the truncate-group branch March 18, 2020 08:13
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

Successfully merging this pull request may close these issues.

Validation schemas missing apiextensions

2 participants