| 1 | Test validation using JsonSchema |
| 2 | The default payload is invalid, try it, then change the age to a valid integer and try again |
| 3 | --- |
| 4 | tags: |
| 5 | - users |
| 6 | parameters: |
| 7 | - name: body |
| 8 | in: body |
| 9 | required: true |
| 10 | schema: |
| 11 | id: User |
| 12 | required: |
| 13 | - username |
| 14 | - age |
| 15 | properties: |
| 16 | username: |
| 17 | type: string |
| 18 | description: The user name. |
| 19 | default: "Sirius Black" |
| 20 | age: |
| 21 | type: integer |
| 22 | description: The user age (should be integer) |
| 23 | default: "180" |
| 24 | tags: |
| 25 | type: array |
| 26 | description: optional list of tags |
| 27 | default: ["wizard", "hogwarts", "dead"] |
| 28 | items: |
| 29 | type: string |
| 30 | |
| 31 | responses: |
| 32 | 200: |
| 33 | description: A single user item |
| 34 | schema: |
| 35 | $ref: '#/definitions/User' |