-
Notifications
You must be signed in to change notification settings - Fork 9.2k
3.3: schema tests for unevaluatedProperties #5095
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
Open
ralfhandl
wants to merge
3
commits into
OAI:v3.3-dev
Choose a base branch
from
ralfhandl:3.3-test-unevaluatedProperrties
base: v3.3-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions
11
tests/schema/fail/discriminator-object-unexpected-property.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.3.0 | ||
| info: | ||
| title: API | ||
| version: 1.0.0 | ||
| components: | ||
| schemas: | ||
| discriminator-with-unevaluated-properties: | ||
| type: object | ||
| discriminator: | ||
| propertyName: foo | ||
| not-allowed: here |
11 changes: 11 additions & 0 deletions
11
tests/schema/fail/schema-object-externalDocs-unexpected-property.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.3.0 | ||
| info: | ||
| title: API | ||
| version: 1.0.0 | ||
| components: | ||
| schemas: | ||
| externalDocs-with-unevaluated-properties: | ||
| type: object | ||
| externalDocs: | ||
| url: https://example.com/docs | ||
| not-allowed: here | ||
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,10 @@ | ||
| openapi: 3.3.0 | ||
| info: | ||
| title: API | ||
| version: 1.0.0 | ||
| components: | ||
| schemas: | ||
| Attr: | ||
| type: string | ||
| xml: | ||
| not-allowed: here |
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,161 @@ | ||
| # Minimal instances of Objects defined in the OpenAPI specification | ||
| # | ||
| # Each instance includes only the required properties for that Object. | ||
| # These instances are used to verify that the Object does not allow additional properties. | ||
|
|
||
| # OpenAPI Object has separate test cases | ||
|
|
||
| - objectName: Info Object | ||
| subSchemaPath: /$defs/info | ||
| minimalInstance: | ||
| title: Sample API | ||
| version: 1.0.0 | ||
|
|
||
| - objectName: Contact Object | ||
| subSchemaPath: /$defs/contact | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: License Object | ||
| subSchemaPath: /$defs/license | ||
| minimalInstance: | ||
| name: Apache 2.0 | ||
|
|
||
| - objectName: Server Object | ||
| subSchemaPath: /$defs/server | ||
| minimalInstance: | ||
| url: https://example.com/docs | ||
|
|
||
| - objectName: Server Variable Object | ||
| subSchemaPath: /$defs/server-variable | ||
| minimalInstance: | ||
| default: defaultValue | ||
|
|
||
| - objectName: Components Object | ||
| subSchemaPath: /$defs/components | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Paths Object | ||
| subSchemaPath: /$defs/paths | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Path Item Object | ||
| subSchemaPath: /$defs/path-item | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Operation Object | ||
| subSchemaPath: /$defs/operation | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: External Documentation Object | ||
| subSchemaPath: /$defs/external-documentation | ||
| minimalInstance: | ||
| url: https://example.com/docs | ||
|
|
||
| - objectName: Parameter Object | ||
| subSchemaPath: /$defs/parameter | ||
| minimalInstance: | ||
| name: sampleParam | ||
| in: query | ||
| schema: # content could also be used, one of them is required | ||
| type: string | ||
|
|
||
| - objectName: Request Body Object | ||
| subSchemaPath: /$defs/request-body | ||
| minimalInstance: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
|
|
||
| - objectName: Media Type Object | ||
| subSchemaPath: /$defs/media-type | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Encoding Object | ||
| subSchemaPath: /$defs/encoding | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Responses Object | ||
| subSchemaPath: /$defs/responses | ||
| minimalInstance: | ||
| default: {} # or "200": {}, any response would do, Responses Object requires at least one response | ||
|
|
||
| - objectName: Response Object | ||
| subSchemaPath: /$defs/response | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Callback Object | ||
| subSchemaPath: /$defs/callbacks | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Example Object | ||
| subSchemaPath: /$defs/example | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: Link Object | ||
| subSchemaPath: /$defs/link | ||
| minimalInstance: | ||
| operationId: sampleOperation # operationRef could also be used, one of them is required | ||
|
|
||
| - objectName: Header Object | ||
| subSchemaPath: /$defs/header | ||
| minimalInstance: | ||
| schema: # content could also be used, one of them is required | ||
| type: string | ||
|
|
||
| - objectName: Tag Object | ||
| subSchemaPath: /$defs/tag | ||
| minimalInstance: | ||
| name: Sample Tag | ||
|
|
||
| # Reference Object allows additional properties (which SHALL be ignored) | ||
|
|
||
| # Schema Object allows additional properties | ||
|
|
||
| # Discriminator Object is defined in meta.yaml, test case fail/discriminator-object-unexpected-property.yaml | ||
|
|
||
| # XML Object is defined in meta.yaml | ||
|
|
||
| - objectName: Security Scheme Object (HTTP Basic) | ||
| subSchemaPath: /$defs/security-scheme | ||
| minimalInstance: | ||
| type: http | ||
| scheme: basic | ||
|
|
||
| - objectName: OAuth Flows Object | ||
| subSchemaPath: /$defs/oauth-flows | ||
| minimalInstance: {} | ||
|
|
||
| - objectName: OAuth Flow Object (implicit) | ||
| subSchemaPath: /$defs/oauth-flows/$defs/implicit | ||
| minimalInstance: | ||
| authorizationUrl: https://example.com/auth | ||
| scopes: {} | ||
|
|
||
| - objectName: OAuth Flow Object (password) | ||
| subSchemaPath: /$defs/oauth-flows/$defs/password | ||
| minimalInstance: | ||
| tokenUrl: https://example.com/token | ||
| scopes: {} | ||
|
|
||
| - objectName: OAuth Flow Object (clientCredentials) | ||
| subSchemaPath: /$defs/oauth-flows/$defs/client-credentials | ||
| minimalInstance: | ||
| tokenUrl: https://example.com/token | ||
| scopes: {} | ||
|
|
||
| - objectName: OAuth Flow Object (authorizationCode) | ||
| subSchemaPath: /$defs/oauth-flows/$defs/authorization-code | ||
| minimalInstance: | ||
| authorizationUrl: https://example.com/auth | ||
| tokenUrl: https://example.com/token | ||
| scopes: {} | ||
|
|
||
| - objectName: OAuth Flow Object (deviceAuthorization) | ||
| subSchemaPath: /$defs/oauth-flows/$defs/device-authorization | ||
| minimalInstance: | ||
| deviceAuthorizationUrl: https://example.com/device | ||
| tokenUrl: https://example.com/auth | ||
| scopes: {} | ||
|
|
||
| # Security Requirement Object allows additional properties |
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
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.