-
Notifications
You must be signed in to change notification settings - Fork 260
chore: implement test cases for types of References in an OpenApi document #2352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a01f21d
feat: register schemas with an identifier
MaggieKimani1 e59fbe6
chore: add test cases for references in OpenApi docs
MaggieKimani1 0212484
chore: remove unimplemented test cases
MaggieKimani1 486ee28
chore: adds recursion for resolving nested subschemas
MaggieKimani1 42a5a2d
chore: remove unused variable
MaggieKimani1 cd4d411
Update src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs
MaggieKimani1 a6e2546
chore: implement PR feedback
MaggieKimani1 aa5292f
chore: clean up
MaggieKimani1 23c5580
chore: merge main into current branch
MaggieKimani1 d27a4fc
feat: resolve JSON pointer path for a relative reference
MaggieKimani1 e0e3095
chore: implement review feedback
MaggieKimani1 88e4406
Merge branch 'main' into feat-handle-relative-references
MaggieKimani1 e39eecc
chore: add and clean up deprecated namespaces
MaggieKimani1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
18 changes: 18 additions & 0 deletions
18
test/Microsoft.OpenApi.Readers.Tests/V31Tests/ReferenceSamples/OAS-schemas.yaml
This file contains hidden or 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,18 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: OpenAPI document containing reusable components | ||
version: 1.0.0 | ||
components: | ||
schemas: | ||
person: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
address: | ||
type: object | ||
properties: | ||
street: | ||
type: string | ||
city: | ||
type: string |
13 changes: 13 additions & 0 deletions
13
...Microsoft.OpenApi.Readers.Tests/V31Tests/ReferenceSamples/componentExternalReference.yaml
This file contains hidden or 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,13 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Example of reference object in a component object | ||
version: 1.0.0 | ||
paths: | ||
/item: | ||
get: | ||
security: | ||
- customapikey: [] | ||
components: | ||
securitySchemes: | ||
customapikey: | ||
$ref: ./customApiKey.yaml#/components/securityschemes/customapikey |
11 changes: 11 additions & 0 deletions
11
test/Microsoft.OpenApi.Readers.Tests/V31Tests/ReferenceSamples/customApiKey.yaml
This file contains hidden or 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 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Example of reference object pointing to a parameter | ||
version: 1.0.0 | ||
paths: {} | ||
components: | ||
securitySchemes: | ||
customapikey: | ||
type: apiKey | ||
name: x-api-key | ||
in: header |
11 changes: 11 additions & 0 deletions
11
test/Microsoft.OpenApi.Readers.Tests/V31Tests/ReferenceSamples/examples.yaml
This file contains hidden or 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 @@ | ||
# file for examples (examples.yaml) | ||
openapi: 3.1.0 | ||
info: | ||
title: OpenAPI document containing examples for reuse | ||
version: 1.0.0 | ||
components: | ||
examples: | ||
item-list: | ||
value: | ||
- name: thing | ||
description: a thing |
14 changes: 14 additions & 0 deletions
14
....OpenApi.Readers.Tests/V31Tests/ReferenceSamples/externalComponentSubschemaReference.yaml
This file contains hidden or 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,14 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Reference to an external OpenApi document component | ||
version: 1.0.0 | ||
paths: | ||
/person/{id}: | ||
get: | ||
responses: | ||
200: | ||
description: ok | ||
content: | ||
application/json: | ||
schema: | ||
$ref: 'OAS-schemas.yaml#/components/schemas/person/properties/address' |
15 changes: 15 additions & 0 deletions
15
test/Microsoft.OpenApi.Readers.Tests/V31Tests/ReferenceSamples/inlineExternalReference.yaml
This file contains hidden or 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 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Example of reference object pointing to an example object in an OpenAPI document | ||
version: 1.0.0 | ||
paths: | ||
/items: | ||
get: | ||
responses: | ||
'200': | ||
description: sample description | ||
content: | ||
application/json: | ||
examples: | ||
item-list: | ||
$ref: './examples.yaml#/components/examples/item-list' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.