nickel
nickel copied to clipboard
`nickel doc` should recognize record contracts as fields
Currently, for a Nickel program like { field | { foo } }
, the JSON documentation generated by nickel doc
contains a pretty printed { foo, }
as a string in the contracts field:
❯ nickel doc --format json --stdout <<<'{ field | { foo } }'
{"field":{"fields":null,"type":null,"contracts":["{ foo, }"],"documentation":null}}
This feels quite silly. We're already able to recognize the fields of a record contract as subfields in the customize mode CLI. We should do the same here.
I would prefer to express which parameters are available in my templates in #1498 as a contract on the parameters
field, which would require this enhancement to be processed by nix at eval time as it is currently.