forked from swagger-api/swagger-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(swagger-api#2104): properly process inline refs in composed schemas
- Loading branch information
Showing
5 changed files
with
116 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
modules/swagger-parser-v3/src/test/resources/issue-2104/depth1/depth2/definitions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
components: | ||
schemas: | ||
ResponseAllOf: | ||
allOf: | ||
- $ref: '../depth2/product/definitions.yaml#/components/schemas/Product' | ||
- type: object | ||
properties: | ||
product: | ||
$ref: '../depth2/product/definitions.yaml#/components/schemas/Product' | ||
ResponseOneOf: | ||
oneOf: | ||
- $ref: '../depth2/product/definitions.yaml#/components/schemas/Product' | ||
- type: object | ||
properties: | ||
product: | ||
$ref: '../depth2/product/definitions.yaml#/components/schemas/Product' | ||
ResponseAnyOf: | ||
anyOf: | ||
- $ref: '../depth2/product/definitions.yaml#/components/schemas/Product' | ||
- type: object | ||
properties: | ||
product: | ||
$ref: '../depth2/product/definitions.yaml#/components/schemas/Product' | ||
|
10 changes: 10 additions & 0 deletions
10
...es/swagger-parser-v3/src/test/resources/issue-2104/depth1/depth2/product/definitions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
components: | ||
schemas: | ||
Product: | ||
type: object | ||
additionalProperties: false | ||
required: | ||
- type | ||
properties: | ||
id: | ||
type: string |
51 changes: 51 additions & 0 deletions
51
modules/swagger-parser-v3/src/test/resources/issue-2104/openapi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: API | ||
description: API | ||
version: LATEST | ||
paths: | ||
/test-all-of: | ||
post: | ||
requestBody: | ||
required: true | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './depth1/depth2/definitions.yaml#/components/schemas/ResponseAllOf' | ||
/test-one-of: | ||
post: | ||
requestBody: | ||
required: true | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './depth1/depth2/definitions.yaml#/components/schemas/ResponseOneOf' | ||
/test-any-of: | ||
post: | ||
requestBody: | ||
required: true | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './depth1/depth2/definitions.yaml#/components/schemas/ResponseAnyOf' |