Framework for objectify API requests

Registered by Qiming Teng

Senlin has provided a rich set of APIs in its version 1.0 release. Moving forward, more APIs will be introduced and existing APIs may get changed. While these changes are inevitable, we do want to ensure that all API parameters are properly validated even in the face of version bumps.

The goals of this validation (framework) are:

- Validate every API parameter;
- Unify the message format and HTTP status code if the causes are the same. For example, "... is too short.", "... is not an integer".
- Cleanup existing ad-hoc parameter validation code;
- Lay foundation for future version changes.

Since all API request bodies are supposed to be encoded in JSON format, we will use JSONSchema validation for this job.

The validation will happen after a request body is deserialized, so it has a potential to support XML parameter encoding.

This work will translate all REST requests into versioned objects and then make use of the schema dumping functionality of versioned objects for parameter validation.

Blueprint information

Status:
Complete
Approver:
Qiming Teng
Priority:
Medium
Drafter:
Qiming Teng
Direction:
Approved
Assignee:
Qiming Teng
Definition:
Approved
Series goal:
Accepted for ocata
Implementation:
Implemented
Milestone target:
milestone icon ocata-2
Started by
Qiming Teng
Completed by
Qiming Teng

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.