@@ -144,12 +144,6 @@ function convertOperation(op,verb,path,pathItem,obj,api) {
144
144
operation . path = path ;
145
145
operation . replacedPathName = path ; //?
146
146
147
- operation . operationId = op . operationId || ( 'operation' + obj . openapi . operationCounter ++ ) ;
148
- operation . operationIdLowerCase = operation . operationId . toLowerCase ( ) ;
149
- operation . operationIdSnakeCase = Case . snake ( operation . operationId ) ;
150
- operation . nickname = operation . operationId ;
151
- //operation.classname = obj.classPrefix+operation.nickname;
152
-
153
147
operation . description = op . description ;
154
148
operation . summary = op . summary ;
155
149
operation . allParams = [ ] ;
@@ -188,6 +182,7 @@ function convertOperation(op,verb,path,pathItem,obj,api) {
188
182
let effParameters = ( op . parameters || [ ] ) . concat ( pathItem . parameters || [ ] ) ;
189
183
effParameters = effParameters . filter ( ( param , index , self ) => self . findIndex ( ( p ) => { return p . name === param . name && p . in === param . in ; } ) === index ) ;
190
184
185
+ const paramList = [ ] ;
191
186
for ( let pa in effParameters ) {
192
187
operation . hasParams = true ;
193
188
let param = effParameters [ pa ] ;
@@ -199,6 +194,7 @@ function convertOperation(op,verb,path,pathItem,obj,api) {
199
194
parameter . isFormParam = false ;
200
195
parameter . paramName = param . name ;
201
196
parameter . baseName = param . name ;
197
+ paramList . push ( param . name ) ;
202
198
parameter . required = param . required || false ;
203
199
parameter . optional = ! parameter . required ;
204
200
if ( parameter . required ) operation . hasRequiredParams = true ;
@@ -267,6 +263,11 @@ function convertOperation(op,verb,path,pathItem,obj,api) {
267
263
}*/
268
264
} // end of effective parameters
269
265
266
+ operation . operationId = op . operationId || Case . camel ( op . tags [ 0 ] + ( paramList ? '_' + paramList . join ( '_' ) + '_' : '' ) + verb ) ;
267
+ operation . operationIdLowerCase = operation . operationId . toLowerCase ( ) ;
268
+ operation . operationIdSnakeCase = Case . snake ( operation . operationId ) ;
269
+ operation . nickname = operation . operationId ;
270
+
270
271
operation . bodyParams = [ ] ;
271
272
if ( op . requestBody ) {
272
273
operation . openapi . requestBody = op . requestBody ;
@@ -401,6 +402,7 @@ function convertOperation(op,verb,path,pathItem,obj,api) {
401
402
entry . openapi = { } ;
402
403
entry . openapi . links = response . links ;
403
404
operation . responses . push ( entry ) ;
405
+ operation . responses = convertArray ( operation . responses ) ;
404
406
}
405
407
406
408
if ( obj . sortParamsByRequiredFlag ) {
@@ -930,7 +932,8 @@ function transform(api, defaults, callback) {
930
932
entry . isNotRequired = ! entry . required ;
931
933
entry . readOnly = ! ! schema . readOnly ;
932
934
entry . type = typeMap ( entry . type , entry . required , schema ) ;
933
- entry . datatype = entry . type ; //?
935
+ entry . dataType = entry . type ; //camelCase for imported files
936
+ entry . datatype = entry . type ; //lower for other files
934
937
entry . jsonSchema = safeJson ( schema , null , 2 ) ;
935
938
for ( let p in schemaProperties ) {
936
939
if ( typeof schema [ p ] !== 'undefined' ) entry [ p ] = schema [ p ] ;
0 commit comments