This repository was archived by the owner on Nov 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 2525 "@apielements/apiaryb-parser" : " ^0.1.0" ,
2626 "@apielements/apib-parser" : " ^0.19.0" ,
2727 "@apielements/apib-serializer" : " ^0.15.0" ,
28- "@apielements/openapi2-parser" : " ^0.31.0 " ,
28+ "@apielements/openapi2-parser" : " ^0.31.1 " ,
2929 "@apielements/openapi3-parser" : " ^0.12.2" ,
3030 "cardinal" : " ^2.1.1" ,
3131 "commander" : " ^5.1.0" ,
Original file line number Diff line number Diff line change 11# API Elements: OpenAPI 2 Parser Changelog
22
3+ ## Master
4+
5+ ### Bug Fixes
6+
7+ - This release includes performance improvements to parsing documents which
8+ contain the same schema re-used via a reference (` $ref ` ) many times in
9+ request parameters and response bodies under an ` allOf ` key.
10+
311## 0.31.0 (2020-05-12)
412
513### Bug Fixes
Original file line number Diff line number Diff line change @@ -1611,7 +1611,16 @@ class Parser {
16111611 const referencedPathValue = this . referencedPathValue ( ) ;
16121612 let cacheKey ;
16131613 if ( referencedPathValue && referencedPathValue . $ref ) {
1614+ // schema object with $ref
16141615 cacheKey = `${ referencedPathValue . $ref } ;${ contentType } ` ;
1616+ } else if (
1617+ referencedPathValue
1618+ && referencedPathValue . allOf
1619+ && Object . keys ( referencedPathValue ) . length === 1
1620+ && referencedPathValue . allOf . length === 1
1621+ && referencedPathValue . allOf [ 0 ] . $ref ) {
1622+ // schema object with single ref in allOf (`allOf: [{$ref: path}]`)
1623+ cacheKey = `${ referencedPathValue . allOf [ 0 ] . $ref } ;${ contentType } ` ;
16151624 }
16161625
16171626 if ( this . generateMessageBody || this . generateMessageBodySchema ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " @apielements/openapi2-parser" ,
3- "version" : " 0.31.0 " ,
3+ "version" : " 0.31.1 " ,
44 "description" : " Swagger 2.0 parser for Fury.js" ,
55 "author" : " Apiary.io <support@apiary.io>" ,
66 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments