Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Version number in API Header #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions swagger_server/controllers/file_formats_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from swagger_server.models.file_formats import FileFormats # noqa: E501
from swagger_server import util


HEADERS = {'PAR-Default-Version': '1.3'}
def file_formats_get(guid=None, name=None, modified_after=None, modified_before=None, offset=None, limit=None): # noqa: E501
"""Get File Formats

Expand All @@ -47,7 +47,7 @@ def file_formats_get(guid=None, name=None, modified_after=None, modified_before=
result_set = FACT.filter_by_guids(result_set, guids)
if modified_before or modified_after:
result_set = FACT.filter_by_date_modified(result_set, modified_before, modified_after)
return FileFormats(FACT.slice_list(result_set, limit, offset))
return FileFormats(FACT.slice_list(result_set, limit, offset)), 200, HEADERS


def file_formats_guid_delete(guid, Authorization): # noqa: E501
Expand Down Expand Up @@ -78,7 +78,7 @@ def file_formats_guid_get(guid): # noqa: E501
ret_val = FACT.get_format(guid)
if not ret_val:
abort(404)
return ret_val
return ret_val, 200, HEADERS


def file_formats_guid_put(guid, Authorization, body=None): # noqa: E501
Expand Down
6 changes: 3 additions & 3 deletions swagger_server/controllers/format_families_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from swagger_server.models.format_family import FormatFamily # noqa: E501
from swagger_server import util


HEADERS = {'PAR-Default-Version': '1.3'}
def format_families_get(file_format_guid=None, file_format_name=None, guid=None, name=None, modified_after=None, modified_before=None, offset=None, limit=None): # noqa: E501
"""Get Format Families

Expand Down Expand Up @@ -48,7 +48,7 @@ def format_families_get(file_format_guid=None, file_format_name=None, guid=None,
result_set = FACT.get_format_families()
if guid:
result_set = filter(lambda family: family.id.guid==guid, result_set)
return FormatFamilies(FACT.slice_list(result_set, limit, offset))
return FormatFamilies(FACT.slice_list(result_set, limit, offset)), 200, HEADERS


def format_families_guid_delete(guid, Authorization): # noqa: E501
Expand Down Expand Up @@ -79,7 +79,7 @@ def format_families_guid_get(guid): # noqa: E501
ret_val = FACT.get_format_family(guid)
if not ret_val:
abort(404)
return ret_val
return ret_val, 200, HEADERS


def format_families_guid_put(guid, Authorization, body=None): # noqa: E501
Expand Down
Loading