jkcfg / kubernetes

Apache License 2.0
26 stars 6 forks source link

Validation schemas missing apiextensions #69

Closed squaremo closed 4 years ago

squaremo commented 4 years ago
Promise rejected at @jkcfg/std/cmd/generate.js 0:0
Error: open /@jkcfg/kubernetes/schemas/v1.16.0-local/customresourcedefinition-apiextensions.k8s.io-v1beta1.json: file does not exist
    at recv (@jkcfg/std/internal/deferred.js:25:27)
    at requestAsPromise (@jkcfg/std/internal/deferred.js:73:34)
    at RPC (@jkcfg/std/internal/rpc.js:50:12)
    at validateWithResource (@jkcfg/std/schema.js:49:12)
    at ref (jkcfg/kubernetes!/@jkcfg/kubernetes/schema.js:13:33)
    at withModuleRef (<EMPTY>/resource:@jkcfg/kubernetes:20:10)
    at validateSchema (jkcfg/kubernetes!/@jkcfg/kubernetes/schema.js:13:12)
    at validate (jkcfg/kubernetes!/@jkcfg/kubernetes/validate.js:9:12)
    at Promise.all.files.map (@jkcfg/std/cmd/generate.js:204:36)
    at Array.map (<anonymous>)
    at @jkcfg/std/cmd/generate.js:203:47
squaremo commented 4 years ago

There is this file: https://github.com/jkcfg/kubernetes-schema/blob/master/v1.16.0-local/customresourcedefinition-apiextensions-v1beta1.json

Perhaps these get treated differently, either how the files are named, or how the filename is constructed.

squaremo commented 4 years ago

Here is the code that decides the name of the file: https://github.com/instrumenta/openapi2jsonschema/blob/master/openapi2jsonschema/command.py#L129

L132 splits the API group into 3 and picks the first item. Keeping in mind I may want to use the same tooling to generate other schemas, the more effective thing to do may be to simply reproduce this logic in the schema picker.