feat(openapi): Add modified typescript-fetch template
This template is modified from the original one, to handle multiple status-code handling of response. Don't ask me how they work, I don't quite understand them in depth...
This commit is contained in:
parent
b7c2a3dff9
commit
5dd6067c95
32 changed files with 2852 additions and 0 deletions
37
openapi-template/modelEnumInterfaces.mustache
Normal file
37
openapi-template/modelEnumInterfaces.mustache
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{{#stringEnums}}
|
||||
/**
|
||||
* {{#lambda.indented_star_1}}{{{unescapedDescription}}}{{/lambda.indented_star_1}}
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum {{classname}} {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{#enumDescription}}
|
||||
/**
|
||||
* {{enumDescription}}
|
||||
*/
|
||||
{{/enumDescription}}
|
||||
{{{name}}} = {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
}
|
||||
{{/stringEnums}}{{^stringEnums}}
|
||||
/**
|
||||
* {{#lambda.indented_star_1}}{{{unescapedDescription}}}{{/lambda.indented_star_1}}
|
||||
* @export
|
||||
*/
|
||||
export const {{classname}} = {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{#enumDescription}}
|
||||
/**
|
||||
* {{enumDescription}}
|
||||
*/
|
||||
{{/enumDescription}}
|
||||
{{{name}}}: {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
} as const;
|
||||
export type {{classname}} = typeof {{classname}}[keyof typeof {{classname}}];
|
||||
{{/stringEnums}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue