Validation of API requests and responses
All API requests and responses must be validated. Validation of requests, responses structure and data types should be extracted to separate validation layer.
Protocol definition should be described in terms of jsonschema. Protocol must be as strict as possible. All required fields must be declared as required, e.t.c.
If request or response is invalid 400 http error is returned with error description and error code in the HTTP response body.
Protocol definition should be bound with the API version.
Steps to implementation:
1. extract validation logic into validation layer,
2. add validation into Node and NodeCollection handlers,
3. make required changes for the validation prototype approvement,
4. add validation into all handlers
Blueprint information
- Status:
- Not started
- Approver:
- Dmitry Pyzhov
- Priority:
- Undefined
- Drafter:
- Alexander Kislitsky
- Direction:
- Needs approval
- Assignee:
- Alexander Kislitsky
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
API jsonschema validation refactoring
Gerrit topic: https:/
Addressed by: https:/
Wrap errors to JSON in Nailgun API
Gerrit topic: https:/
Addressed by: https:/
Initial JSONSchema validation
Gerrit topic: https:/
Gerrit topic: https:/