We have already executed our first schematic. Now, we have the opportunity to address the question: “What happens when we need input from the user before starting our schematics?”
What is a schema json?
JSON schemas are used to validate JSON data. They provide a way to define rules, properties, and configurations for your JSON. An example of this is the angular.json file.
Every JSON object can have a $schema property, which allows us to reference the schema containing all the rules and configurations. The $schema property can point to a local file or a URL link.
In the context of a schematic, the schema enables us to ask users different types of questions before executing the schematic. However, you might wonder, “Daniel, what if I need to ask a question during the execution of the schematic, rather than just before it?” The simple answer is that schemas do not allow for this. However, there is another approach to accomplish it, which we will explore in a future article.
Here you can see all the information about a schema and all the questions that you can make to users.