I have a schema that has a component that is defined like:
AFooSpec:
type: "object"
properties:
displayName:
type: "string"
description: "Name to display on user screens ([a-zA-Z0-9 _-])."
pattern: "^[a-zA-Z0-9][a-zA-Z0-9_\\- ]+[a-zA-Z0-9]$"
enabled:
type: "boolean"
title: "Automatically Provision"
description: "Auto Provision the Shared Cluster"
default: true
x-kubernetes-preserve-unknown-fields: true
allOf:
- if:
properties:
enabled:
const: true
then:
required:
- displayName
else:
required: [ ]
When parsed, I end up with:
components:
schemas:
AFooSpec:
allOf:
- {}
properties:
displayName:
description: Name to display on user screens ([a-zA-Z0-9 _-]).
pattern: ^[a-zA-Z0-9][a-zA-Z0-9_\- ]+[a-zA-Z0-9]$
type: string
enabled:
default: true
description: Auto Provision the Shared Cluster
title: Automatically Provision
type: boolean
type: object
x-kubernetes-preserve-unknown-fields: true
description: 'generated by: ../services/afoo/afoo-xrd.yaml'
I have a schema that has a component that is defined like:
When parsed, I end up with: