-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JSON Schema 2019-09+ validation keyword
fixes #1558
- Loading branch information
1 parent
aefb024
commit 3097b08
Showing
8 changed files
with
189 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@redocly/openapi-core": minor | ||
--- | ||
|
||
add JSON Schema draft 2019-09+ validation keyword - dependentRequired |
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
34 changes: 34 additions & 0 deletions
34
__tests__/lint/spec-json-schema-validation-dependentRequired/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,34 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: test json schema validation keyword - dependentRequired | ||
version: 1.0.0 | ||
paths: | ||
'/thing': | ||
get: | ||
summary: a sample api | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/test_schema' | ||
examples: | ||
dependentRequired_passing: | ||
summary: an example schema | ||
value: { 'name': 'bobby', 'age': 25 } | ||
dependentRequired_failing: | ||
summary: an example schema | ||
value: { 'name': 'jennie' } | ||
components: | ||
schemas: | ||
test_schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
age: | ||
type: number | ||
dependentRequired: | ||
name: | ||
- age |
6 changes: 6 additions & 0 deletions
6
__tests__/lint/spec-json-schema-validation-dependentRequired/redocly.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,6 @@ | ||
apis: | ||
main: | ||
root: ./openapi.yaml | ||
|
||
rules: | ||
spec: error |
11 changes: 11 additions & 0 deletions
11
__tests__/lint/spec-json-schema-validation-dependentRequired/snapshot.js
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`E2E lint spec-json-schema-validation-dependentRequired 1`] = ` | ||
validating /openapi.yaml... | ||
/openapi.yaml: validated in <test>ms | ||
Woohoo! Your API description is valid. 🎉 | ||
`; |
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
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