Quantcast
Channel: User user2297996 - Stack Overflow
Viewing all articles
Browse latest Browse all 37

How to customize schematics schema.json?

$
0
0

Is it possible to customise Angular schematics schema.json?I wanna add extra properties to the schema.In other words, I would like top extend the schematics schema.json syntax. How to do that?

{"$schema": "http://json-schema.org/schema","$id": "SomeId","title": "Some","type": "object","properties": {"name": {"type": "string","minLength": 1,"description": "Name of something","default": "","MyExtraProp": 12"x-prompt": "Some prompt"    }  },"required": ["name"]}

I created my own schematics CLI which is based on the reference implementation:

https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/schematics_cli/bin/schematics.ts

How can I make schematics to actually recognise "MyExtraProp" and pass it to my PromptProvider?

function _createPromptProvider(): schema.PromptProvider {  return (definitions) => {// definitions contains schema.PromptDefinition array. But my custom prop is not part of it, it's ignored....}

Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>