-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ruleset-migrator): invalid values for JSON Schema drafts 2019 & 2…
…020 (#1756) * fix(ruleset-migrator): invalid values for JSON Schema drafts 2019 & 2020 * feat(ruleset-migrator): alias json-schema-2019-09 and json-schema-2020-12
- Loading branch information
Showing
12 changed files
with
78 additions
and
31 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
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
4 changes: 2 additions & 2 deletions
4
packages/ruleset-migrator/src/__tests__/__fixtures__/formats-variant-1/output.mjs
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { oas2, oas3_1, oas3_0, jsonSchemaLoose } from '@stoplight/spectral-formats'; | ||
import { oas2, oas3_1, oas3_0, jsonSchemaLoose, jsonSchemaDraft2019_09 } from '@stoplight/spectral-formats'; | ||
export default { | ||
formats: [oas2, oas3_1, oas3_0, jsonSchemaLoose], | ||
formats: [oas2, oas3_1, oas3_0, jsonSchemaLoose, jsonSchemaDraft2019_09], | ||
rules: {}, | ||
}; |
2 changes: 1 addition & 1 deletion
2
packages/ruleset-migrator/src/__tests__/__fixtures__/formats-variant-1/ruleset.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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
formats: [oas2, oas3.1, oas3.0, json-schema-loose] | ||
formats: [oas2, oas3.1, oas3.0, json-schema-loose, json-schema-draft-2019-09] | ||
rules: {} |
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
2 changes: 1 addition & 1 deletion
2
packages/ruleset-migrator/src/__tests__/__fixtures__/formats-variant-2/output.mjs
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
16 changes: 16 additions & 0 deletions
16
packages/ruleset-migrator/src/__tests__/__fixtures__/formats-variant-3/output.cjs
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,16 @@ | ||
const { | ||
jsonSchemaDraft2019_09: jsonSchemaDraft2019_09, | ||
jsonSchemaDraft2020_12: jsonSchemaDraft2020_12, | ||
} = require('@stoplight/spectral-formats'); | ||
const { truthy: truthy } = require('@stoplight/spectral-functions'); | ||
module.exports = { | ||
formats: [jsonSchemaDraft2019_09, jsonSchemaDraft2020_12], | ||
rules: { | ||
test: { | ||
given: '$', | ||
then: { | ||
function: truthy, | ||
}, | ||
}, | ||
}, | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/ruleset-migrator/src/__tests__/__fixtures__/formats-variant-3/output.mjs
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,13 @@ | ||
import { jsonSchemaDraft2019_09, jsonSchemaDraft2020_12 } from '@stoplight/spectral-formats'; | ||
import { truthy } from '@stoplight/spectral-functions'; | ||
export default { | ||
formats: [jsonSchemaDraft2019_09, jsonSchemaDraft2020_12], | ||
rules: { | ||
test: { | ||
given: '$', | ||
then: { | ||
function: truthy, | ||
}, | ||
}, | ||
}, | ||
}; |
10 changes: 10 additions & 0 deletions
10
packages/ruleset-migrator/src/__tests__/__fixtures__/formats-variant-3/ruleset.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,10 @@ | ||
formats: | ||
- json-schema-2019-09 | ||
- json-schema-draft-2019-09 | ||
- json-schema-draft-2020-12 | ||
- json-schema-2020-12 | ||
rules: | ||
test: | ||
given: $ | ||
then: | ||
function: truthy |
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