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.
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/