-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1557 from johanra/master
fix handling of relative references
- Loading branch information
Showing
8 changed files
with
152 additions
and
40 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
5 changes: 5 additions & 0 deletions
5
...-parser-v3/src/test/resources/relative-references-example/_responses/UnexpectedError.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,5 @@ | ||
description: unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref : "../_schemas/error.yaml" |
9 changes: 9 additions & 0 deletions
9
modules/swagger-parser-v3/src/test/resources/relative-references-example/_schemas/error.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,9 @@ | ||
type: object | ||
properties: | ||
code: | ||
type: string | ||
message: | ||
type: string | ||
required: | ||
- code | ||
- message |
16 changes: 16 additions & 0 deletions
16
modules/swagger-parser-v3/src/test/resources/relative-references-example/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,16 @@ | ||
openapi: 3.0.1 | ||
info: | ||
version: 1.0.0 | ||
title: x | ||
description: desc | ||
license: | ||
name: public domain | ||
contact: | ||
name: API Support | ||
url: http://www.example.com/support | ||
email: [email protected] | ||
paths: | ||
/authorize: | ||
$ref: 'security/_resources/authorize.yaml' | ||
/login: | ||
$ref: 'security/_resources/login.yaml' |
15 changes: 15 additions & 0 deletions
15
...rser-v3/src/test/resources/relative-references-example/security/_resources/authorize.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,15 @@ | ||
post: | ||
tags: | ||
- Security | ||
description: authorize the user | ||
summary: authorize the user | ||
operationId: authorize.user | ||
responses: | ||
"200": | ||
description: authorize 200 response | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
default: | ||
$ref: '../../_responses/UnexpectedError.yaml' |
24 changes: 24 additions & 0 deletions
24
...r-parser-v3/src/test/resources/relative-references-example/security/_resources/login.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 @@ | ||
post: | ||
tags: | ||
- Security | ||
description: login | ||
summary: login | ||
operationId: login | ||
parameters: [] | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../_schemas/usernamepasswordcredentials.yaml' | ||
application/x-www-form-urlencoded: | ||
schema: | ||
$ref: '../_schemas/usernamepasswordcredentials.yaml' | ||
required: true | ||
responses: | ||
"200": | ||
description: login 200 response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
security: [] |
11 changes: 11 additions & 0 deletions
11
.../resources/relative-references-example/security/_schemas/usernamepasswordcredentials.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,11 @@ | ||
required: | ||
- password | ||
- username | ||
type: object | ||
properties: | ||
password: | ||
minLength: 1 | ||
type: string | ||
username: | ||
minLength: 1 | ||
type: string |