Files
notifications-api/app/template_folder/template_folder_schema.py
Pea Tyczynska 103033a330 Change name of update method for template folder
It was initialy called "rename" which does not comply with
RESTful CRUD (create, update, read, delete) naming practice.
We remove the 'rename' operation in favour of template folder
resource update endpoint as it allows us to extend it with other
attributes.
2018-11-12 14:28:07 +00:00

34 lines
1.0 KiB
Python

from app.schema_validation.definitions import nullable_uuid, uuid
post_create_template_folder_schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "POST schema for getting template_folder",
"type": "object",
"properties": {
"name": {"type": "string", "minLength": 1},
"parent_id": nullable_uuid
},
"required": ["name", "parent_id"]
}
post_update_template_folder_schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "POST schema for updating template_folder",
"type": "object",
"properties": {
"name": {"type": "string", "minLength": 1},
},
"required": ["name"]
}
post_move_template_folder_schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "POST schema for renaming template_folder",
"type": "object",
"properties": {
"templates": {"type": "array", "items": uuid},
"folders": {"type": "array", "items": uuid},
},
"required": ["templates", "folders"]
}