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
26
openapi-template/ApiEntitiesRecord.mustache
Normal file
26
openapi-template/ApiEntitiesRecord.mustache
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import {Map, Record, RecordOf} from 'immutable';
|
||||
|
||||
import {
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{#isEntity}}
|
||||
{{classname}}RecordEntity,
|
||||
{{/isEntity}}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
} from "./models/index{{importFileExtension}}"
|
||||
|
||||
export const ApiEntitiesRecordProps = {
|
||||
recType: "ApiEntitiesRecord" as "ApiEntitiesRecord",
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{#isEntity}}
|
||||
{{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}: ({{classname}}RecordEntity(), Map<string, {{classname}}RecordEntity>()),
|
||||
{{/isEntity}}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
};
|
||||
|
||||
export type ApiEntitiesRecordPropsType = typeof ApiEntitiesRecordProps;
|
||||
export const ApiEntitiesRecord = Record(ApiEntitiesRecordProps, ApiEntitiesRecordProps.recType);
|
||||
export type ApiEntitiesRecord = RecordOf<ApiEntitiesRecordPropsType>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue