Skip to content

Instantly share code, notes, and snippets.

@anfibiacreativa
Created February 14, 2019 10:22
Show Gist options
  • Save anfibiacreativa/3dabce765d0c13e9f92680830cff37a1 to your computer and use it in GitHub Desktop.
Save anfibiacreativa/3dabce765d0c13e9f92680830cff37a1 to your computer and use it in GitHub Desktop.
Validation schema for angular schematics
{
"$schema": "http://json-schema.org/schema",
"id": "SchematicsGenerateFilesApp",
"title": "Application Options Schema for Angular projects feat Aliased SASS",
// the type of the schema object (obviously object!)
"type": "object",
// the properties of that object
"properties": {
// name, maps to an option you expect from the command line, flagged --name
"name": {
"description": "The name of the application.",
// you expect for it to be a string
"type": "string",
"$default": {
"$source": "argv",
"index": 0
}
}
},
// it is requiered! (so your schematic will fail if you don't pass this option)
"required": [
"name"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment