Skip to content

Commit

Permalink
[openapi.json] fix openapi.json + respect max char 80 in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBldy committed Sep 14, 2023
1 parent fe3c3f7 commit f5d3379
Showing 1 changed file with 55 additions and 28 deletions.
83 changes: 55 additions & 28 deletions zou/app/blueprints/user/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get(self, project_id, asset_type_id):
responses:
200:
description: Assets of which type is given asset type and are
listed in given project
listed in given project
"""
projects_service.get_project(project_id)
assets_service.get_asset_type(asset_type_id)
Expand All @@ -208,21 +208,24 @@ def get(self):
- User
responses:
200:
description: Open projects for which the user has at least one task assigned
description: Open projects for which the user has at least
one task assigned
"""
name = self.get_text_parameter("name")
return user_service.get_open_projects(name=name)


class ProjectSequencesResource(Resource):
"""
Return sequences related to given project if the current user has access to it.
Return sequences related to given project if the current user has access
to it.
"""

@jwt_required()
def get(self, project_id):
"""
Return sequences related to given project if the current user has access to it.
Return sequences related to given project if the current user has access
to it.
---
tags:
- User
Expand Down Expand Up @@ -250,7 +253,8 @@ class ProjectEpisodesResource(Resource):
@jwt_required()
def get(self, project_id):
"""
Return episodes related to given project if the current user has access to it.
Return episodes related to given project if the current user has access
to it.
---
tags:
- User
Expand All @@ -271,13 +275,15 @@ def get(self, project_id):

class ProjectAssetTypesResource(Resource):
"""
Return asset types related to given project if the current user has access to it.
Return asset types related to given project if the current user has access
to it.
"""

@jwt_required()
def get(self, project_id):
"""
Return asset types related to given project if the current user has access to it.
Return asset types related to given project if the current user has
access to it.
---
tags:
- User
Expand Down Expand Up @@ -305,7 +311,8 @@ class SequenceShotsResource(Resource):
@jwt_required()
def get(self, sequence_id):
"""
Return shots related to given sequence if the current user has access to it.
Return shots related to given sequence if the current user has access
to it.
---
tags:
- User
Expand Down Expand Up @@ -333,7 +340,8 @@ class SequenceScenesResource(Resource):
@jwt_required()
def get(self, sequence_id):
"""
Return scenes related to given sequence if the current user has access to it.
Return scenes related to given sequence if the current user has access
to it.
---
tags:
- User
Expand Down Expand Up @@ -442,7 +450,8 @@ class TodosResource(Resource):
@jwt_required()
def get(self):
"""
Return tasks currently assigned to current user and of which status has is_done attribute set to false.
Return tasks currently assigned to current user and of which status has
is_done attribute set to false.
---
tags:
- User
Expand All @@ -465,7 +474,8 @@ def get(self):
- User
responses:
200:
description: Tasks requiring feedback in current user departments.
description: Tasks requiring feedback in current user
departments.
"""
if permissions.has_supervisor_permissions():
return user_service.get_tasks_to_check()
Expand All @@ -482,7 +492,8 @@ class DoneResource(Resource):
@jwt_required()
def get(self):
"""
Return tasks currently assigned to current user and of which status has is_done attribute set to true.
Return tasks currently assigned to current user and of which status has
is_done attribute set to true.
---
tags:
- User
Expand Down Expand Up @@ -546,7 +557,8 @@ def post(self):
example: a24a6ea4-ce75-4665-a070-57453082c25
responses:
201:
description: Filter for current user and only for open projects created
description: Filter for current user and only for open projects
created
"""
arguments = self.get_arguments()

Expand Down Expand Up @@ -884,7 +896,8 @@ class NotificationResource(Resource):
@jwt_required()
def get(self, notification_id):
"""
Return notification matching given id, only if it's a notification that belongs to current user.
Return notification matching given id, only if it's a notification that
belongs to current user.
---
tags:
- User
Expand Down Expand Up @@ -924,15 +937,17 @@ def get(self, task_id):
x-example: a24a6ea4-ce75-4665-a070-57453082c25
responses:
200:
description: True if current user has subscribed to given task, False otherwise
description: True if current user has subscribed to given task,
False otherwise
"""
return user_service.has_task_subscription(task_id)


class TaskSubscribeResource(Resource):
"""
Create a subscription entry for given task and current user.
When a user subscribes, he gets notified everytime a comment is posted on the task.
When a user subscribes, he gets notified everytime a comment is posted on
the task.
"""

@jwt_required()
Expand All @@ -942,7 +957,8 @@ def post(self, task_id):
---
tags:
- User
description: When a user subscribes, he gets notified everytime a comment is posted on the task.
description: When a user subscribes, he gets notified everytime a
comment is posted on the task.
parameters:
- in: path
name: task_id
Expand Down Expand Up @@ -970,7 +986,8 @@ def delete(self, task_id):
---
tags:
- User
description: The user will no longer receive notifications for this task.
description: The user will no longer receive notifications for
this task.
parameters:
- in: path
name: task_id
Expand All @@ -994,7 +1011,8 @@ class HasSequenceSubscribedResource(Resource):
@jwt_required()
def get(self, sequence_id, task_type_id):
"""
Return true if current user has subscribed to given sequence and task type.
Return true if current user has subscribed to given sequence and
task type.
---
tags:
- User
Expand All @@ -1013,7 +1031,8 @@ def get(self, sequence_id, task_type_id):
x-example: a24a6ea4-ce75-4665-a070-57453082c25
responses:
200:
description: True if current user has subscribed to given sequence and task type, False otherwise
description: True if current user has subscribed to given
sequence and task type, False otherwise
"""
return user_service.has_sequence_subscription(
sequence_id, task_type_id
Expand All @@ -1023,17 +1042,20 @@ def get(self, sequence_id, task_type_id):
class SequenceSubscribeResource(Resource):
"""
Create a subscription entry for given sequence, task type and current user.
When a user subscribes, he gets notified every time a comment is posted on tasks related to the sequence.
When a user subscribes, he gets notified every time a comment is posted
on tasks related to the sequence.
"""

@jwt_required()
def post(self, sequence_id, task_type_id):
"""
Create a subscription entry for given sequence, task type and current user.
Create a subscription entry for given sequence,
task type and current user.
---
tags:
- User
description: When a user subscribes, he gets notified every time a comment is posted on tasks related to the sequence.
description: When a user subscribes, he gets notified every
time a comment is posted on tasks related to the sequence.
parameters:
- in: path
name: sequence_id
Expand Down Expand Up @@ -1065,7 +1087,8 @@ class SequenceUnsubscribeResource(Resource):
@jwt_required()
def delete(self, sequence_id, task_type_id):
"""
Remove a subscription entry for given sequence, tasl type and current user.
Remove a subscription entry for given sequence, tasl type
and current user.
---
tags:
- User
Expand All @@ -1092,13 +1115,15 @@ def delete(self, sequence_id, task_type_id):

class SequenceSubscriptionsResource(Resource):
"""
Return the list of sequence ids to which the current user has subscribed for given task type.
Return the list of sequence ids to which the current user has subscribed
for given task type.
"""

@jwt_required()
def get(self, project_id, task_type_id):
"""
Return the list of sequence ids to which the current user has subscribed for given task type.
Return the list of sequence ids to which the current user has
subscribed for given task type.
---
tags:
- User
Expand All @@ -1117,7 +1142,8 @@ def get(self, project_id, task_type_id):
x-example: a24a6ea4-ce75-4665-a070-57453082c25
responses:
200:
description: List of sequence ids to which the current user has subscribed for given task type
description: List of sequence ids to which the current user
has subscribed for given task type
"""
return user_service.get_sequence_subscriptions(
project_id, task_type_id
Expand Down Expand Up @@ -1257,7 +1283,8 @@ def get(self):
- User
responses:
200:
description: Context to properly run a full app connected to the API
description: Context to properly run a full app connected
to the API
"""
return user_service.get_context()

Expand Down

0 comments on commit f5d3379

Please sign in to comment.