File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 57
57
"eslint" : " eslint ." ,
58
58
"eslint:fix" : " eslint . --fix" ,
59
59
"prepublishOnly" : " npm run clean && npm run release" ,
60
- "codecov" : " codecov --token=66c30c23-8954-4892-bef9-fbaed0a2e42b"
60
+ "codecov" : " codecov --token=66c30c23-8954-4892-bef9-fbaed0a2e42b" ,
61
+ "prepare" : " npm run release"
61
62
},
62
63
"dependencies" : {
63
64
"camelcase" : " ^6.3.0" ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ type Config = Options & {
12
12
filterMethod : 'greedy' | 'ascetic' ;
13
13
filterArray : string [ ] ;
14
14
input : string ;
15
+ useSaddlebackServices ?: boolean ;
15
16
} ;
16
17
17
18
export const generateCustomSpec = async ( config : Config ) => {
@@ -98,6 +99,17 @@ export const generateCustomSpec = async (config: Config) => {
98
99
} ) ;
99
100
} ) ;
100
101
}
102
+ if ( 'requestBody' in requestMethodData ) {
103
+ const requestBodyContent = Object . values ( requestMethodData . requestBody ?. content ?? { } ) ;
104
+
105
+ // add schemas from {apiPath}/{method}/responses/{responseType}/requestBody/content
106
+ requestBodyContent . forEach ( content => {
107
+ const modelName = getSchemaRefFromContent ( content ) ;
108
+
109
+ requiredSchemasSet . add ( getSchemaRefFromContent ( content ) ) ;
110
+ recursiveAddAllUnknownModels ( modelName ) ;
111
+ } ) ;
112
+ }
101
113
}
102
114
}
103
115
} ) ;
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ export const fetch{{{../name}}}{{pascalCase name}} = async ({{> saddlebackParame
51
51
contentType: '{{{ parametersBody.mediaType }}} ',
52
52
{{ /if }}
53
53
{{ /if }}
54
+ ...config,
54
55
});
55
56
56
57
try {
Original file line number Diff line number Diff line change 7
7
params,
8
8
{{ else if parametersQuery}}
9
9
params,
10
- {{ /if ~}} }: {
10
+ {{ /if }}
11
+ config,
12
+ }: {
11
13
{{ #if parametersBody }}
12
14
data: {{ #equals parametersBody.in ' formData' }} FormData;{{ else }} {{{ parametersBody.type }}} ;{{ /equals }}
13
15
{{ /if }}
70
72
{{ /each }}
71
73
};
72
74
{{ /if }}
75
+ /**
76
+ * Config to add or overwrite getBaseConfig arguments
77
+ */
78
+ config?: Partial<Parameters <typeof getBaseConfig>[0]>;
73
79
}{{ /if }}
You can’t perform that action at this time.
0 commit comments