-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to verify external reference resolution both by $id and $re…
…f locator works
- Loading branch information
1 parent
06d499a
commit 76763dd
Showing
3 changed files
with
92 additions
and
4 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
21 changes: 21 additions & 0 deletions
21
.../Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithExternalRef.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,21 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: ReferenceById | ||
version: 1.0.0 | ||
paths: | ||
/resource: | ||
get: | ||
parameters: | ||
- name: id | ||
in: query | ||
required: true | ||
schema: | ||
$ref: 'https://example.com/schemas/user.json' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './externalResource.yaml#/components/schemas/todo' | ||
components: {} |
22 changes: 22 additions & 0 deletions
22
test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalResource.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,22 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: ReferencedById | ||
version: 1.0.0 | ||
paths: {} | ||
components: | ||
schemas: | ||
todo: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
name: | ||
type: string | ||
user: | ||
$id: 'https://example.com/schemas/user.json' | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
name: | ||
type: string |