Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: #114 marking description fields as optional on different namespaces
  • Loading branch information
enriquezrene committed Apr 27, 2020
commit d31cfc9426e9f4335dc2c8f61c7bf3ecb36621dc
4 changes: 2 additions & 2 deletions time_tracker_api/activities/activities_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from flask_restplus._http import HTTPStatus

from time_tracker_api.activities.activities_model import create_dao
from time_tracker_api.api import common_fields, api, remove_required_constraint
from time_tracker_api.api import common_fields, api, remove_required_constraint, NullableString

faker = Faker()

Expand All @@ -18,7 +18,7 @@
description='Canonical name of the activity',
example=faker.word(['Development', 'Training']),
),
'description': fields.String(
'description': NullableString(
title='Description',
required=False,
description='Comments about the activity',
Expand Down
4 changes: 2 additions & 2 deletions time_tracker_api/customers/customers_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from flask_restplus import Resource, fields
from flask_restplus._http import HTTPStatus

from time_tracker_api.api import common_fields, api, remove_required_constraint
from time_tracker_api.api import common_fields, api, remove_required_constraint, NullableString
from time_tracker_api.customers.customers_model import create_dao

faker = Faker()
Expand All @@ -18,7 +18,7 @@
description='Name of the customer',
example=faker.company(),
),
'description': fields.String(
'description': NullableString(
title='Description',
required=False,
max_length=250,
Expand Down
5 changes: 3 additions & 2 deletions time_tracker_api/project_types/project_types_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from flask_restplus import Resource, fields
from flask_restplus._http import HTTPStatus

from time_tracker_api.api import common_fields, create_attributes_filter, api, UUID, remove_required_constraint
from time_tracker_api.api import common_fields, create_attributes_filter, api, UUID, remove_required_constraint, \
NullableString
from time_tracker_api.project_types.project_types_model import create_dao

faker = Faker()
Expand All @@ -18,7 +19,7 @@
description='Name of the project type',
example=faker.random_element(["Customer", "Training", "Internal"]),
),
'description': fields.String(
'description': NullableString(
title='Description',
required=False,
max_length=250,
Expand Down
5 changes: 3 additions & 2 deletions time_tracker_api/projects/projects_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from flask_restplus import Resource, fields
from flask_restplus._http import HTTPStatus

from time_tracker_api.api import common_fields, create_attributes_filter, UUID, api, remove_required_constraint
from time_tracker_api.api import common_fields, create_attributes_filter, UUID, api, remove_required_constraint, \
NullableString
from time_tracker_api.projects.projects_model import create_dao

faker = Faker()
Expand All @@ -18,7 +19,7 @@
description='Name of the project',
example=faker.company(),
),
'description': fields.String(
'description': NullableString(
title='Description',
required=False,
max_length=250,
Expand Down