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
28
openapi-template/sagaApiManager.mustache
Normal file
28
openapi-template/sagaApiManager.mustache
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import {
|
||||
Configuration,
|
||||
ConfigurationParameters,
|
||||
} from "../index{{importFileExtension}}";
|
||||
|
||||
import {
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
{{classFilename}},
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
} from "./index{{importFileExtension}}";
|
||||
|
||||
export class Api {
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
public static {{#lambda.camelcase}}{{classFilename}}{{/lambda.camelcase}}: {{classFilename}};
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
|
||||
public static init(apiBaseConfig: ConfigurationParameters) {
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
Api.{{#lambda.camelcase}}{{classFilename}}{{/lambda.camelcase}} = new {{classFilename}}(new Configuration(apiBaseConfig));
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue