Closed julienperignon closed 4 years ago
I've also encountered this with the istio manifest, located here: https://raw.githubusercontent.com/istio/istio/1.5.4/manifests/base/files/crd-all.gen.yaml
I believe it's related to how the union code expects to handle these objects assuming they're all going to have type properties, not other sub objects.
Here's an example of the spec that causes a validation failure:
http:
description: An ordered list of route rules for HTTP traffic.
items:
properties:
fault:
description: Fault injection policy to apply on HTTP traffic at
the client side.
properties:
delay:
oneOf:
- anyOf:
- required:
- fixedDelay
- required:
- exponentialDelay
- required:
- fixedDelay
- required:
- exponentialDelay
properties:
exponentialDelay:
type: string
fixedDelay:
description: Add a fixed delay before forwarding the request.
type: string
percent:
description: Percentage of requests on which the delay
will be injected (0-100).
format: int32
type: integer
percentage:
description: Percentage of requests on which the delay
will be injected.
properties:
value:
format: double
type: number
type: object
type: object
type: object
type: object
type: array
Describe the bug When trying to import the virtualservice CRD from Istio the import fails midway
To Reproduce
npm run import https://gist.githubusercontent.com/julienperignon/bc2ca51e90408a8e3d5cf632900f5267/raw/b0fa0cc5bfef428b0c6bb3894adf25f8be686ac9/virtualservice.yaml
Expected behavior CLI should not fail imports/virtualservice.ts should be complete
Additional context
package.json
Error :