dart-lang / macros

A Dart mono-repo for macro development.
BSD 3-Clause "New" or "Revised" License
20 stars 2 forks source link

Add generation of comments; add coments to schema; add file for exten… #11

Closed davidmorgan closed 1 month ago

davidmorgan commented 1 month ago

Fix #6

Go with extensions on extension types, and generation of comments.

There's just one wrinkle with generation of comments, which is that when you $ref a type it pulls in the description of the type as the description of the property. So the description of the field Foo myFoo; is copied from Foo, which is not what you want.

It's possible to use allOf to specify a second description, but that's pretty ugly, I suggest we use $comment, which is slightly worse in terms of what it means (nothing!) but looks nicer in the schema and is fine for generation. It's a bit annoying that we have to remember to use $comment only next to $ref, but that's easier to remember than using allOf with a description next to $ref :) what do you think?