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 25
25
"@apielements/apiaryb-parser" : " ^0.1.0" ,
26
26
"@apielements/apib-parser" : " ^0.19.0" ,
27
27
"@apielements/apib-serializer" : " ^0.15.0" ,
28
- "@apielements/openapi2-parser" : " ^0.31.0 " ,
28
+ "@apielements/openapi2-parser" : " ^0.31.1 " ,
29
29
"@apielements/openapi3-parser" : " ^0.12.2" ,
30
30
"cardinal" : " ^2.1.1" ,
31
31
"commander" : " ^5.1.0" ,
Original file line number Diff line number Diff line change 1
1
# API Elements: OpenAPI 2 Parser Changelog
2
2
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
+
3
11
## 0.31.0 (2020-05-12)
4
12
5
13
### Bug Fixes
Original file line number Diff line number Diff line change @@ -1611,7 +1611,16 @@ class Parser {
1611
1611
const referencedPathValue = this . referencedPathValue ( ) ;
1612
1612
let cacheKey ;
1613
1613
if ( referencedPathValue && referencedPathValue . $ref ) {
1614
+ // schema object with $ref
1614
1615
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 } ` ;
1615
1624
}
1616
1625
1617
1626
if ( this . generateMessageBody || this . generateMessageBodySchema ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @apielements/openapi2-parser" ,
3
- "version" : " 0.31.0 " ,
3
+ "version" : " 0.31.1 " ,
4
4
"description" : " Swagger 2.0 parser for Fury.js" ,
5
5
"author" :
" Apiary.io <[email protected] >" ,
6
6
"license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments