Validating task status in the API
Adding enum for task statuses validation in API Story: 2001432 Task: 22469 Change-Id: I39e9227b7dcc39be1fbea131918a3874b1631017
This commit is contained in:
parent
379b606dcc
commit
7cba7ced39
@ -136,10 +136,13 @@ class ProjectGroup(base.APIBase):
|
||||
name="Infra",
|
||||
title="Awesome projects")
|
||||
|
||||
TaskStatuses = wtypes.Enum(wtypes.text, 'todo', 'inprogress',
|
||||
'invalid', 'review', 'merged')
|
||||
|
||||
|
||||
class TaskStatusCount(base.APIBase):
|
||||
"""Represents a task status and number of occurrences within a story."""
|
||||
key = wtypes.text
|
||||
key = wtypes.wsattr(TaskStatuses)
|
||||
count = int
|
||||
|
||||
@classmethod
|
||||
@ -300,11 +303,9 @@ class Task(base.APIBase):
|
||||
title = wtypes.text
|
||||
"""An optional short label for the task, to show in listings."""
|
||||
|
||||
# TODO(ruhe): replace with enum
|
||||
status = wtypes.text
|
||||
"""Status.
|
||||
Allowed values: ['todo', 'inprogress', 'invalid', 'review', 'merged'].
|
||||
Human readable versions are left to the UI.
|
||||
status = wtypes.wsattr(TaskStatuses)
|
||||
"""The type of statuses allowed ['todo', 'inprogress',
|
||||
'invalid', 'review', 'merged'].
|
||||
"""
|
||||
|
||||
creator_id = int
|
||||
|
Loading…
x
Reference in New Issue
Block a user