News for hackers. Stuff that matters.
Re:Show HN: A faster way to prototype your APIs using OpenAP... by 0xffff2 on Friday October 23, 2020 @10:58AM (#24870140)
I spend weeks looking for tools that I could even us, much less like, and eventually gave up and wrote everything by hand. I would be very interested in hearing about any OpenAPI tools that you would recommend.
Re:Show HN: A faster way to prototype your APIs using OpenAP... by smt88 on Saturday October 24, 2020 @07:49PM (#24882810)
For .NET, it's best to write the spec as annotations on your controllers and request/response classes using NSwag[1].

The situation is similar in the Java world. It's better to annotate, rather than start with your own spec.

For TypeScript, I mostly use a CLI tool[2] that generates type definitions, which I then use in my routing system and controllers to make sure that any changes to paths, requests, and responses are going to cause compiler errors until they're fixed.

1. https://docs.microsoft.com/en-us/aspnet/core/tutorials/getti...

2. https://github.com/horiuchi/dtsgenerator/