This repository was archived by the owner on Nov 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed 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 ) {
You can’t perform that action at this time.
0 commit comments