Validation of input parameters through JSON Schema
Nova, Cinder and Keystone have used JSON Schema to validate input parameters in start of operation itself instead of going ahead and reported error after error occurs.
We should follow same in Manila.
Nova JSON Schema Validation::
## Validation:
def validate(self, *args, **kwargs):
try:
except jsonschema.
# NOTE: For whole OpenStack message consistency, this error
# message has been written as the similar format of WSME.
if len(ex.path) > 0:
else:
raise exception.
except TypeError as ex:
# NOTE: If passing non string value to patternProperties parameter,
# TypeError happens. Here is for catching the TypeError.
detail = six.text_type(ex)
raise exception.
## At API layer:
https:/
@validation
def _create_
"""Backup a server instance.
https:/
Cinder JSON Schema Validation:
[1] https:/
[2] https:/
Blueprint information
- Status:
- Started
- Approver:
- Goutham Pacha Ravi
- Priority:
- Low
- Drafter:
- Dongdong Pei
- Direction:
- Approved
- Assignee:
- Dongdong Pei
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Slow progress
- Milestone target:
- None
- Started by
- Goutham Pacha Ravi
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Add json schema validation for Manila APIs
Addressed by: https:/
V2 jsonschema validation: base schema framework & share-types