Day 11: Validation
Number of APIs: 2
Instructions for Day 11: Validation
- Get the challenge: Fork the parent collection to your own public workspace.
- Read the documentation: Select the first folder. Expand the context bar on the right to follow the instructions in the collection documentation.
- Submit your solution: Select the second folder and follow the instructions in the documentation to validate your solution.
Learning objectives
- Validate responses against a defined schema
- Explain the importance of schema validation
- Write a conditional test to validate various responses
- Write a negative test to validate an unsuccessful response
Concepts covered
- [Writing tests]
- [Validating responses]
Additional resources
- [ajv] and other built-in libraries
- [Validate using ajv] code sample
- Validate data formats using JSON schema
- [Validate API definitions] docs
- [Security warnings during API definition] blog
GET
https://api.getpostman.com/collections/20019195-18cdfeaa-3ecc-411b-8621-49bdb6e78787
GET
https://pokeapi.co/api/v2/berry/60000