Repository navigation
Schematics schema should take custom validation functions #12705
Description
Activity
- addedfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
on Oct 23, 2018 As I understand schematics uses
inquirerinside. We could usevalidationproperty with reference to a file and a function. And call it after json schema validation pass."x-prompt": { "message": "Insert a name", "validate": "./validation#checkNameUniqness" },Function should accept options that was inserted by user before.
- addedfeature: votes requiredFeature request which is currently still in the voting phaseFeature request which is currently still in the voting phase
on Feb 1, 2022 Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
- addedfeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authorsand removedfeature: votes requiredFeature request which is currently still in the voting phaseFeature request which is currently still in the voting phase
on Feb 21, 2022 Thank you for taking the time to submit this feature request.
At this time, we are not planning to implement this feature, as it did not gather sufficient community interest and we want to be mindful of expanding the CLI configuration surface area when existing workarounds are available.
We will be closing this issue as not planned for now, though we are happy to reconsider it in the future if community interest changes.
Bug Report or Feature Request (mark with an
x)Desired functionality
I would like to be able to specify validation functions for options of a schematic in the schema. JSON Schema does have some built-in validation, but this doesn't cover everything.
Here are a couple of examples that are not covered by JSON Schema:
A workaround is to perform this type of validation within the schematic function itself, however, this is not the best possible user experience when using the prompt system. As a user, I would expect my input to be validated as I enter it, then re-prompted for if necessary. With this workaround, a user would need to re-invoke the program from the beginning if their input is found invalid within the schematic function.