@@ -348,6 +348,7 @@ export class SchemaRoutes {
348348 operationId,
349349 defaultType,
350350 typeName,
351+ doNotMatchUnnamedTypesByContent,
351352 } ) => {
352353 // TODO: make more flexible pick schema without content type
353354 const schema = this . getSchemaFromRequestType ( requestInfo ) ;
@@ -364,7 +365,7 @@ export class SchemaRoutes {
364365 ( parsedSchema ) =>
365366 this . typeNameFormatter . format ( parsedSchema . name ) === content ,
366367 ) ;
367- const foundSchemaByContent = parsedSchemas . find ( ( parsedSchema ) =>
368+ const foundSchemaByContent = doNotMatchUnnamedTypesByContent ? null : parsedSchemas . find ( ( parsedSchema ) =>
368369 lodash . isEqual ( parsedSchema . content , content ) ,
369370 ) ;
370371
@@ -412,6 +413,7 @@ export class SchemaRoutes {
412413 parsedSchemas,
413414 operationId,
414415 defaultType,
416+ doNotMatchUnnamedTypesByContent,
415417 } ) =>
416418 lodash . reduce (
417419 requestInfos ,
@@ -432,6 +434,7 @@ export class SchemaRoutes {
432434 parsedSchemas,
433435 operationId,
434436 defaultType,
437+ doNotMatchUnnamedTypesByContent,
435438 } ) ,
436439 ) ,
437440 description :
@@ -460,6 +463,7 @@ export class SchemaRoutes {
460463 parsedSchemas,
461464 operationId,
462465 defaultType : this . config . defaultResponseType ,
466+ doNotMatchUnnamedTypesByContent : this . config . doNotMatchUnnamedTypesByContent ,
463467 } ) ;
464468
465469 const successResponse = responseInfos . find (
@@ -538,7 +542,7 @@ export class SchemaRoutes {
538542 ) ;
539543 } ;
540544
541- getRequestBodyInfo = ( routeInfo , routeParams , parsedSchemas , routeName ) => {
545+ getRequestBodyInfo = ( routeInfo , routeParams , parsedSchemas , routeName , doNotMatchUnnamedTypesByContent ) => {
542546 const { requestBody, consumes, requestBodyName, operationId } = routeInfo ;
543547 let schema = null ;
544548 let content = null ;
@@ -583,6 +587,7 @@ export class SchemaRoutes {
583587 parsedSchemas,
584588 operationId,
585589 typeName,
590+ doNotMatchUnnamedTypesByContent,
586591 } ) ,
587592 ) ;
588593
@@ -943,6 +948,7 @@ export class SchemaRoutes {
943948 routeParams ,
944949 parsedSchemas ,
945950 routeName ,
951+ this . config . doNotMatchUnnamedTypesByContent ,
946952 ) ;
947953
948954 const requestParamsSchema = this . createRequestParamsSchema ( {
0 commit comments