-
Notifications
You must be signed in to change notification settings - Fork 307
Open
Labels
Description
JSON schema allows a JSON file to self identify its schema using the $schema key. This should also be possible with YAML.
without first saving to a file, $schema should enable validation and auto-completion
$schema: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
version: '3'
services:
hello:
image: hello-world
Further, this should enable use of local schema files.
For example, using the product catalog example from https://json-schema.org/learn/getting-started-step-by-step.html
If I were to save the final product catalog JSON schema locally to /usr/shared/productCatalog.json
I can then implement a product catalog with validation and auto-completion:
$schema: /usr/shared/productCatalog.json
productId: 123
productName: "self identify YAML schema"