Streamline OperationHandler API in TypeScript #55
elmerbulthuis
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
currently, a typical operation handler looks something like this:
This is quite a lot of boilerplate! We want to clean this up. Especially this part:
The status, could be optionally if there is only one 2xx response. This is then the default. Also this could be a string that is the name of a well known status. Then if there are no parameters or if all parameters are optional we can omit the parameters.
So something like this:
Then, we should have a default content-type. This is usually the first in a list of request types. If there is only one then this is the default. Finally the entity member should be a property. If we apply that as well we get:
The entire handler would look something like thid:
Beta Was this translation helpful? Give feedback.
All reactions