Last active
April 29, 2022 10:32
-
-
Save paulgoetze/95d8d85f34145bec5413a6bd25f80b9c to your computer and use it in GitHub Desktop.
Testing Your Python API App with JSON Schema - tests/support/schemas/user.json
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
// tests/support/schemas/user.json | |
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "User response schema", | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "object", | |
"properties": { | |
"type": {"enum": ["users"]}, | |
"id": {"type": "number"}, | |
"attributes": { | |
"type": "object", | |
"properties": { | |
"email": {"type": "string", "format": "email"}, | |
"username": {"type": "string"} | |
}, | |
"required": ["email", "username"] | |
} | |
}, | |
"required": ["type", "id", "attributes"] | |
} | |
}, | |
"additionalProperties": false, | |
"required": ["data"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment