Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiamberardino committed Oct 17, 2022
2 parents e059e0c + af0ab16 commit b0838f2
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ You can include this library from Sonatype OSS for SNAPSHOTS, or Maven central f
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
<version>2.1.4</version>
<version>2.1.5</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-parser-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>swagger-parser-project</artifactId>
<groupId>io.swagger.parser.v3</groupId>
<version>2.1.5-SNAPSHOT</version>
<version>2.1.6-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -69,7 +69,7 @@
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-v3</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.1.6-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion modules/swagger-parser-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-project</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.1.6-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion modules/swagger-parser-v2-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-project</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.1.6-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion modules/swagger-parser-v3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-project</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.1.6-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public ResolverFully(boolean aggregateCombinators) {
private Map<String, Link> links;
private Map<String, Schema> resolvedProperties = new IdentityHashMap<>();
private Map<String, Callback> callbacks;

public void resolveFully(OpenAPI openAPI) {
Components components = openAPI.getComponents();
if (components != null && components.getRequestBodies() != null) {
Expand Down Expand Up @@ -85,7 +85,7 @@ public void resolveFully(OpenAPI openAPI) {
if (headers == null) {
headers = new HashMap<>();
}
}
}

if (components != null && components.getParameters() != null) {
parameters = components.getParameters();
Expand Down Expand Up @@ -243,7 +243,7 @@ public Header resolveHeader(Header header){
}
return header;
}

public Link resolveLink(Link link){
RefFormat refFormat = computeRefFormat(link.get$ref());
String $ref = link.get$ref();
Expand Down Expand Up @@ -272,7 +272,7 @@ public RequestBody resolveRequestBody(RequestBody requestBody){
}
return requestBody;
}

public Callback resolveCallback(Callback callback){
RefFormat refFormat = computeRefFormat(callback.get$ref());
String $ref = callback.get$ref();
Expand Down Expand Up @@ -502,6 +502,12 @@ private void aggregateSchemaCombinators(ComposedSchema sourceSchema, Schema targ
targetSchema.addExtension(key, extensions.get(key));
}
}
if (sourceSchema.getExtensions() != null) {
Map<String, Object> extensions = sourceSchema.getExtensions();
for (String key : extensions.keySet()) {
targetSchema.addExtension(key, sourceSchema.getExtensions().get(key));
}
}
}

if (requiredProperties.size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,42 @@ paths:
data2:
type: string
x-extension-ref: 1
/test/extensions/not/inherited/bothinline:
get:
responses:
"200":
description: "A test failing on the merge of extensions in a allOf, with\
\ same extension defined in referencing and referenced"
content:
application/json:
schema:
required:
- data
properties:
data:
type: string
data2:
type: string
x-extension-ref: 3
/test/extensions/not/inherited/both:
get:
responses:
"200":
description: "A test failing on the merge of extensions in a allOf, with\
\ same extension defined in referencing and referenced"
content:
application/json:
schema:
required:
- data
- gps
type: object
properties:
data:
type: string
gps:
type: string
x-extension-ref: 2
components:
schemas:
ResponseModel:
Expand All @@ -31,3 +67,14 @@ components:
data:
type: string
x-extension-ref: 1
ExtendedResponseModel:
required:
- data
- gps
type: object
properties:
data:
type: string
gps:
type: string
x-extension-ref: 2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ components:
properties:
data:
type: "string"
ExtendedResponseModel:
type: object
x-extension-ref: 2
allOf:
- $ref: '#/components/schemas/ResponseModel'
- type: object
required:
- gps
properties:
gps:
type: string

paths:
/test/extensions/not/inherited:
Expand All @@ -28,4 +39,28 @@ paths:
- type: "object"
properties:
data2:
type: "string"
type: "string"
/test/extensions/not/inherited/bothinline:
get:
responses:
200:
description: "A test failing on the merge of extensions in a allOf, with same extension defined in referencing and referenced"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ResponseModel"
- type: "object"
x-extension-ref: 3
properties:
data2:
type: "string"
/test/extensions/not/inherited/both:
get:
responses:
200:
description: "A test failing on the merge of extensions in a allOf, with same extension defined in referencing and referenced"
content:
application/json:
schema:
$ref: "#/components/schemas/ExtendedResponseModel"
2 changes: 1 addition & 1 deletion modules/swagger-parser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-project</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.1.6-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-project</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.1.6-SNAPSHOT</version>
<packaging>pom</packaging>
<name>swagger-parser-project</name>
<developers>
Expand Down

0 comments on commit b0838f2

Please sign in to comment.