Open
Description
As a concrete example, I'm attempting to convert various helm charts such as cert-manager into Dhall and there are various errors in the CustomResourceDefinition and related CustomResourceValidation types that are supposed to use JSONSchema:
- JSONSchemaProps
externalDocumentation
is required but has its fields marked as optional. The property is actually optional.properties
has aText
value. It should be of typeJSONSchema
, whatever that might be.
- JSONSchemaPropsOrBool, JSONSchemaPropsOrArray, JSONSchemaPropsOrStringArray
- All of these types are generated as
{}
. They should reference a recursiveJSONSchema
type similarly toJSONSchemaProps.properties
.
- All of these types are generated as
- JSON
- Is generated as
{}
. Probably it should point to eitherPrelude.JSON.Type
orText
. (I personally find the former untenable outside of automated conversion.)
- Is generated as
Some thoughts/observations:
- I've currently 'solved' this by inlining entire
CustomResourceDefinition
's YAML asText
and post-processing this to decode theText
into a JSONValue
and reinsert it into the YAML/JSON AST when converting Dhall to YAML. - Probably the JSONSchema related types should not be generated and there should be a separate JSONSchema Dhall package that is pulled in as a dependency, since the spec is versioned and won't be subject to change on
dhall-kubernetes
regeneration. Prelude.JSON.Type
could be used as a shorter-term solution - but it's absolutely horrendous to work with when trying to represent ad-hoc JSON by hand.
Metadata
Metadata
Assignees
Labels
No labels