From f5d3379f6d40df0ca1e7e493b27b2dc7c3a907a8 Mon Sep 17 00:00:00 2001 From: Evan Blaudy Date: Thu, 14 Sep 2023 18:06:54 +0200 Subject: [PATCH] [openapi.json] fix openapi.json + respect max char 80 in docstrings --- zou/app/blueprints/user/resources.py | 83 ++++++++++++++++++---------- 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/zou/app/blueprints/user/resources.py b/zou/app/blueprints/user/resources.py index e1b1dcb739..031f5bca46 100644 --- a/zou/app/blueprints/user/resources.py +++ b/zou/app/blueprints/user/resources.py @@ -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) @@ -208,7 +208,8 @@ 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) @@ -216,13 +217,15 @@ def get(self): 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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() @@ -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 @@ -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() @@ -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 @@ -924,7 +937,8 @@ 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) @@ -932,7 +946,8 @@ def get(self, 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() @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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()