зеркало из https://github.com/Azure/autorest.git
b900c8e6c6
* wip * make perform-load work when no inputs * adding more info to header printout * filter out stuff not needed here * update to 2018 |
||
---|---|---|
.. | ||
Client | ||
ClientFancy | ||
shell | ||
property-defaults.yaml | ||
readme.md |
readme.md
Using property default values in constructors
input-file: property-defaults.yaml
Regular run
csharp:
- output-folder: Client
Run using property defaults in constructors
csharp:
- output-folder: ClientFancy
directive:
from: code-model-v1
where: $..*[?(@.$type == "CompositeType")].properties[*]
transform: $.useDefaultInConstructor = true
The directive activates the useDefaultInConstructor
for all properties.
Note that this granularity also allows activating the features only for some model classes or even some individual properties.