-
Notifications
You must be signed in to change notification settings - Fork 92
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 #560 from tdakkota/fix/validate-components-key
fix(parser): validate component map key as spec says
- Loading branch information
Showing
11 changed files
with
347 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
openapi/parser/_testdata/negative/components/invalid_callbacks_component_name.json
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,33 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"callbacks": { | ||
"foo!bar": { | ||
"http://localhost:1000": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
openapi/parser/_testdata/negative/components/invalid_examples_component_name.json
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,25 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"examples": { | ||
"foo!bar": { | ||
"value": true | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
openapi/parser/_testdata/negative/components/invalid_headers_component_name.json
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,27 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"headers": { | ||
"foo!bar": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
openapi/parser/_testdata/negative/components/invalid_links_component_name.json
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,25 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"links": { | ||
"foo!bar": { | ||
"operationId": "foo" | ||
} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
openapi/parser/_testdata/negative/components/invalid_parameters_component_name.json
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,29 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"parameters": { | ||
"foo!bar": { | ||
"name": "foobar", | ||
"in": "query", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
openapi/parser/_testdata/negative/components/invalid_pathItems_component_name.json
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,31 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"pathItems": { | ||
"foo!bar": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
openapi/parser/_testdata/negative/components/invalid_requestBodies_component_name.json
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,31 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"requestBodies": { | ||
"foo!bar": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
openapi/parser/_testdata/negative/components/invalid_responses_component_name.json
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,25 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"responses": { | ||
"foo!bar": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
openapi/parser/_testdata/negative/components/invalid_schemas_component_name.json
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,25 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"foo!bar": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
openapi/parser/_testdata/negative/components/invalid_securitySchemes_component_name.json
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,27 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "title", | ||
"version": "v0.1.0" | ||
}, | ||
"paths": { | ||
"/foo": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "User info" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"securitySchemes": { | ||
"foo!bar": { | ||
"type": "apiKey", | ||
"name": "Authorization", | ||
"in": "header" | ||
} | ||
} | ||
} | ||
} |
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