Proposal: __traits(getComment, symbol)

Eugene Wissner belka at caraus.de
Wed Aug 28 09:55:47 UTC 2019


On Wednesday, 28 August 2019 at 09:35:54 UTC, Sebastiaan Koppe 
wrote:
> Just create a Swagger struct (plus helper structs) and use like:
>
> ```
> @Swagger(ApiResponses([
>     ApiResponse(code = 200, message = "...", response = Entity),
>     ApiResponse(code = 404, message = "listing not found")
>   ]),
>   Put("/entities/{id}"),
>   Consumes([MediaType.APPLICATION_JSON_VALUE]),
>   Produces([MediaType.APPLICATION_JSON_VALUE])
> )
> Entity endpoint(string id) { ... }
> ```
>
> I think it beats parsing (or writing) comments...

and provides some static typing, because structs can be used, and 
probably better error messages than reinventing a Ddoc parser.


More information about the Digitalmars-d mailing list