autorest/Samples/test/use-default-in-constructor
Garrett Serack b900c8e6c6 More info (#2801)
* wip

* make perform-load work when no inputs

* adding more info to header printout

* filter out stuff not needed here

* update to 2018
2018-01-12 16:59:57 -08:00
..
Client
ClientFancy
shell
property-defaults.yaml
readme.md

readme.md

Using property default values in constructors

see https://aka.ms/autorest

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.