Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add soft response schema validation (#1657)
* refactor: remove most schema refs * refactor: generalize request/response schemas * refactor: simplify schema date formats * refactor: add soft response schema validation * refactor: fix emptySchema definition * refactor: update json-schema-to-ts and use refs
- Loading branch information
Showing
62 changed files
with
903 additions
and
636 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
69 changes: 69 additions & 0 deletions
69
src/lib/openapi/spec/__snapshots__/feature-schema.test.ts.snap
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,69 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`featureSchema constraints 1`] = ` | ||
Object { | ||
"data": Object { | ||
"name": "a", | ||
"strategies": Array [ | ||
Object { | ||
"constraints": Array [ | ||
Object { | ||
"contextName": "a", | ||
}, | ||
], | ||
"name": "a", | ||
}, | ||
], | ||
}, | ||
"errors": Array [ | ||
Object { | ||
"instancePath": "/strategies/0/constraints/0", | ||
"keyword": "required", | ||
"message": "must have required property 'operator'", | ||
"params": Object { | ||
"missingProperty": "operator", | ||
}, | ||
"schemaPath": "#/components/schemas/constraintSchema/required", | ||
}, | ||
], | ||
"schema": "#/components/schemas/featureSchema", | ||
} | ||
`; | ||
|
||
exports[`featureSchema overrides 1`] = ` | ||
Object { | ||
"data": Object { | ||
"name": "a", | ||
"variants": Array [ | ||
Object { | ||
"name": "a", | ||
"overrides": Array [ | ||
Object { | ||
"contextName": "a", | ||
"values": "b", | ||
}, | ||
], | ||
"payload": Object { | ||
"type": "a", | ||
"value": "b", | ||
}, | ||
"stickiness": "a", | ||
"weight": 1, | ||
"weightType": "a", | ||
}, | ||
], | ||
}, | ||
"errors": Array [ | ||
Object { | ||
"instancePath": "/variants/0/overrides/0/values", | ||
"keyword": "type", | ||
"message": "must be array", | ||
"params": Object { | ||
"type": "array", | ||
}, | ||
"schemaPath": "#/components/schemas/overrideSchema/properties/values/type", | ||
}, | ||
], | ||
"schema": "#/components/schemas/featureSchema", | ||
} | ||
`; |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.