templating icon indicating copy to clipboard operation
templating copied to clipboard

Mandatory parameters (isRequired) missing in schema

Open matkoch opened this issue 8 years ago • 5 comments

Seems that all parameters are optional. Are there any plans to support mandatory parameters as well?

matkoch avatar May 13 '18 22:05 matkoch

Hi, you can mark each symbol as "isRequired":"true"

Example :

"symbols": { "firstParameter": { "isRequired": "true", "type": "parameter", "datatype": "string", "replaces": "MY_FIRST_PARAMETER_TO_REPLACE", "description": "First mandatory parameter" }, "secondParameter": { "isRequired": "true", "type": "parameter", "datatype": "string", "replaces": "MY_SECOND_PARAMETER_TO_REPLACE", "description": "Second mandatory parameter" }, "thirdParameter": { "isRequired": "false", "type": "parameter", "datatype": "string", "replaces": "MY_THIRD_PARAMETER_TO_REPLACE", "description": "Third optional parameter" } }

Is it what you're asking for ?

marcusien avatar May 14 '18 08:05 marcusien

Nice, thanks @marcusien. It's not listed in the schema though.

matkoch avatar May 14 '18 12:05 matkoch

Didn't know what you provided ☺️

In my case I always used what's listed on this link. Don't hesitate to take a look https://github.com/dotnet/templating/wiki/"Runnable-Project"-Templates

marcusien avatar May 14 '18 19:05 marcusien

I'll leave this open.

matkoch avatar May 20 '18 16:05 matkoch

https://github.com/SchemaStore/schemastore/pull/493 has been merged which should take care of this.

mlorbetske avatar Jul 15 '18 01:07 mlorbetske