export type OperationHandler<A extends ServerAuthentication> = (
parameters: OperationRequestParameters, //optional, only if these are specified
requestContentType: string, // optional, only if there are possibly more content types
requestEntity: OperationRequestEntity, // optional, only if there is a request body. This can also be a generator
authentication: OperationAuthentication<A>, // optional, only present if there is authentication
accepts: accept.OperationAccept[], // optionally, only if there are multiple reponse types
) => Promise<[
status: number, // optional, only ifthere
parameters: OperationResponseParameters, // optional, only if response parameters are specified
responseContentType: string, // optional, only if multiple response content types are possible
responseEntity: OperationResponseEntity // optional, only if there is a response body, this can also be a generator.
]>; // if the tuple has only one field, then the return type is just that field.
The generated operation handlers are all in the form:
This could be a lot simpler, like this
This will make for a much easier server api.