diff --git a/crc/api.yml b/crc/api.yml index 5d120aaa..7e7d4be1 100644 --- a/crc/api.yml +++ b/crc/api.yml @@ -716,10 +716,31 @@ components: properties: id: type: string + name: + type: string display_name: type: string description: type: string + primary_process_id: + type: string + nullable: true + workflow_spec_category_id: + type: integer + nullable: true + workflow_spec_category: + $ref: "#/components/schemas/WorkflowSpecCategory" + is_status: + type: boolean + nullable: true + WorkflowSpecCategory: + properties: + id: + type: integer + name: + type: string + display_name: + type: string File: properties: id: diff --git a/crc/models/workflow.py b/crc/models/workflow.py index 48e58f17..1665063a 100644 --- a/crc/models/workflow.py +++ b/crc/models/workflow.py @@ -23,7 +23,7 @@ class WorkflowSpecModel(db.Model): display_name = db.Column(db.String) description = db.Column(db.Text) primary_process_id = db.Column(db.String) - workflow_spec_category_id = db.Column(db.Integer, db.ForeignKey('workflow_spec_category.id')) + workflow_spec_category_id = db.Column(db.Integer, db.ForeignKey('workflow_spec_category.id'), nullable=True) workflow_spec_category = db.relationship("WorkflowSpecCategoryModel") is_status = db.Column(db.Boolean, default=False) diff --git a/tests/test_workflow_spec_api.py b/tests/test_workflow_spec_api.py index 08faf16f..7f29cc92 100644 --- a/tests/test_workflow_spec_api.py +++ b/tests/test_workflow_spec_api.py @@ -25,7 +25,7 @@ class TestWorkflowSpec(BaseTest): def test_add_new_workflow_specification(self): self.load_example_data(); num_before = session.query(WorkflowSpecModel).count() - spec = WorkflowSpecModel(id='make_cookies', display_name='Cooooookies', + spec = WorkflowSpecModel(id='make_cookies', name='make_cookies', display_name='Cooooookies', description='Om nom nom delicious cookies') rv = self.app.post('/v1.0/workflow-specification', headers=self.logged_in_headers(),