yaml / yamlscript

Programming in YAML
MIT License
387 stars 31 forks source link

Schema support #20

Open ingydotnet opened 10 months ago

ingydotnet commented 10 months ago

By default, YS only supports the tags provided by the YAML 1.2 JSON Schema which include: !!map, !!seq, !!str, !!bool, !!int, !!float.

Any other tag will error because it is not known by the schema and thus not able to load.

Tags are seldomly used in YAML, but some projects like Amazon CloudFormation make good use of them.

We need to provide a way for a YS program to declare its schema.

Two ideas that come to mind are:

A YS starting tag extension:

!yamlscript/v0?schema=CloudFormation

Or a namespace declaration addition:

ns foo:
  schema: aws-cloudformation/schema-v1.2.3

There are obviously details to work out about how/where one hosts a custom schema.

colltoaction commented 8 months ago

Check this solution: https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning