From 629dbf30a282ccd86af18c1659d366b638caada5 Mon Sep 17 00:00:00 2001 From: Guiqiang Zhang Date: Tue, 9 Aug 2016 11:09:48 +0800 Subject: [PATCH] replace apiary with swagger --- apiary.apib | 633 --------------------------------- swagger.yaml | 977 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 977 insertions(+), 633 deletions(-) delete mode 100644 apiary.apib create mode 100644 swagger.yaml diff --git a/apiary.apib b/apiary.apib deleted file mode 100644 index 0c70297..0000000 --- a/apiary.apib +++ /dev/null @@ -1,633 +0,0 @@ -FORMAT: 1A -HOST: https://api.topcoder.com/v3 - -# ap-review-microservice - -Services to enable members to review assets. - -It includes functionality for scorecards, scorecard questions, reviews, -review items, scoring individual reviews, aggregating review scores. - -## Aggregate scores [PUT /reviews/{challengeId}/aggregateScores/] -Performs score aggragation for a given challenge. -During the review process, reviewers will create multiple reviews. Each review is -individually scored at the time that it is saved. At the end of the review phase -these individual reviews need to be processed and aggregated to generate the final -score for a given submission in a given challenge, updating the scores in the -submission and generating the project result records. - -+ Response 200 (application/json) - - { - "id": "-791fe5af:14fb45217ea:-7ff8", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": null - }, - "content": "OK" - }, - "version": "v3" - } - -## Gets copilot feedback [GET /feedbacks/copilots/{handle}] -Fetches feedback records for a given copilot - -+ Parameters - + limit - number of feedback records to be retrieved. If this is greater than 50, only 50 records are returned (ex: limit=50) - + offset - pagination offset (ex: offset=101) - -+ Response 200 (application/json) - - { - "id": "-77190b52:15039405e2d:-8000", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": 5 - }, - "content": [ - { - "updatedAt": "2012-10-29T21:37Z", - "createdAt": "2012-10-29T21:35Z", - "createdBy": "8547899", - "updatedBy": "8547899", - "userId": 15050434, - "reviewText": "FireIce is very dependable. He has a good handle on the TopCoder process and also has a good \"system level\" understanding. He has been good at decomposing high level concepts into actionable items.", - "timeRating": null, - "qualityRating": null, - "communicationRating": null, - "managementRating": null, - "copilotProjectId": 828, - "directProjectId": 4507, - "directProjectName": "TC - Analytics Development Env" - } - ] - }, - "version": "v3" - } - -## Assign next review [PUT /reviews/{challengeId}/assignNextReview] -For peer review challenges, assign next review will look for the next submission -that the currently logged in user has to review, and perform the association. - -Note: - -The review phase of the challenge must be open; - -The member must have submitted to the challenge; - -There must still be submissions available for the member to review. I.e. submissions of other members that the member has not yet reviewed; - -If the member has 5 or more reviews, they can only start a new review if all other reviews have been submitted (committed = 1) - -The response content is the new review ID. The /reviews endpoint can be used to fetch it. - -+ Request - - + Headers - - Authorization: Bearer (required) - -+ Response 200 (application/json) - - { - "id": "-77190b52:15039405e2d:-8000", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": 5 - }, - "content": "12345" - }, - "version": "v3" - } - -## Fetch reviews [GET /reviews/] -Fetches reviews - -Note: Users may only see reviews that they created, or submitted reviews (commited = 1) of their own submissions done by other users. - -+ Parameters - + limit - How many records to return - + offset - How many records to skip - + filter - key=value pairs - * challengeId id of the challenge - -+ Request - - + Headers - - Authorization: Bearer (required) - -+ Response 200 (application/json) - - { - "id": "4ff9fa1b:15012e95fe9:-7f8f", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": 6 - }, - "content": [ - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-06T22:34Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 321916, - "resourceId": null, - "submissionId": 506577, - "projectPhaseId": null, - "scorecardId": null, - "committed": 1, - "uploadId": 506596, - "score": null, - "initialScore": null, - "reviewerUserId": 1800089, - "submitterUserId": 1800141 - } - ] - }, - "version": "v3" - } - -## Review [/reviews/{reviewId}] -APIs for reviews - -### Get review [GET /reviews/{reviewId}] -Fetches a specific review - -Note: Users may only see review that they created, or submitted reviews (commited = 1) of their own submissions done by other users. - -+ Parameters - - + filter (string, optional) - the filter in key=value format - * challengeId (enum[string], optional) Id of the challenge for which to retrieve reviews () - + limit (number, optional) Maximum number of results to be returned. Only a maximun of 50 records can be retrieved at a time (DEFAULT: 20) - + offset (number, optional) Offset to return results from (DEFAULT: 0) - -+ Request - - + Headers - - Authorization: Bearer (required) - -+ Response 200 (application/json) - - { - "id": "4ff9fa1b:15012e95fe9:-7f8f", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": null - }, - "content": { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-06T22:34Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 321916, - "resourceId": null, - "submissionId": 506577, - "projectPhaseId": null, - "scorecardId": null, - "committed": 1, - "uploadId": 506596, - "score": null, - "initialScore": null, - "reviewerUserId": 1800089, - "submitterUserId": 1800141 - } - }, - "version": "v3" - } - -### Update review [PUT /reviews/{reviewId}] -Updates a review - -Note: - -Users may only update reviews that they created and have not been submitted yet (commited = 0). - -The only field that can be updated is the committed field. - -+ Request (application/json) - - + Headers - - Authorization: Bearer (required) - + Body - - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-06T22:34Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 321916, - "resourceId": null, - "submissionId": 506577, - "projectPhaseId": null, - "scorecardId": null, - "committed": 1, - "uploadId": 506596, - "score": null, - "initialScore": null, - "reviewerUserId": 1800089, - "submitterUserId": 1800141 - } - -+ Response 200 (application/json) - - { - "id": "4ff9fa1b:15012e95fe9:-7f8f", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": null - }, - "content": null - }, - "version": "v3" - } - - -## Review [/reviewItems/] -API for review items - -### Get review items [GET /reviewItems/] -Fetches review items - -Note: Users may only see reviews items related to reviews that they created, or submitted reviews (commited = 1) of their own submissions done by other users. - -+ Parameters - - + filter (string, optional) - the filter in key=value format - * reviewId (enum[string], optional) Id of the review for which to retrieve review items () - + limit (number, optional) Maximum number of results to be returned. Only a maximun of 50 records can be retrieved at a time (DEFAULT: 20) - + offset (number, optional) Offset to return results from (DEFAULT: 0) - -+ Request - - + Headers - - Authorization: Bearer (required) - -+ Response 200 (application/json) - - { - "id": "4ff9fa1b:15012e95fe9:-7f8a", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": 5 - }, - "content": [ - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 6727675, - "reviewId": 321916, - "scorecardQuestionId": 30005883, - "uploadId": 506596, - "answer": "0", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - }, - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 6727676, - "reviewId": 321916, - "scorecardQuestionId": 30005884, - "uploadId": 506596, - "answer": "1", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - }, - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 6727677, - "reviewId": 321916, - "scorecardQuestionId": 30005885, - "uploadId": 506596, - "answer": "2", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - }, - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 6727678, - "reviewId": 321916, - "scorecardQuestionId": 30005886, - "uploadId": 506596, - "answer": "test", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - }, - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "id": 6727679, - "reviewId": 321916, - "scorecardQuestionId": 30005887, - "uploadId": 506596, - "answer": "3413", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - } - ] - }, - "version": "v3" - } - -### Create review items [POST /reviewItems/] -Creates new review items - -Note: Users may only create review items related to reviews that they created and are not submitted (committed = 0). - -+ Request (application/json) - - + Headers - - Authorization: Bearer (required) - - + Body - - [ - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "reviewId": 321916, - "scorecardQuestionId": 30005883, - "uploadId": 506596, - "answer": "0", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - }, - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "reviewId": 321916, - "scorecardQuestionId": 30005884, - "uploadId": 506596, - "answer": "1", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - } - ] - -+ Response 200 (application/json) - - { - "id": "4ff9fa1b:15012e95fe9:-7f8f", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": null - }, - "content": [12345, 78901] - }, - "version": "v3" - } - - -### Updates review items [PUT /reviewItems/] -Updates review items - -Note: Users may only update review items related to reviews that they created and are not submitted (committed = 0). - -+ Request - - + Headers - - Authorization: Bearer (required) - - + Body - - [ - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "reviewId": 321916, - "scorecardQuestionId": 30005883, - "id": 1234, - "uploadId": 506596, - "answer": "0", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - }, - { - "updatedAt": "2015-04-07T19:40Z", - "createdAt": "2015-04-07T19:40Z", - "createdBy": "1800089", - "updatedBy": "1800089", - "reviewId": 321916, - "scorecardQuestionId": 30005884, - "id": 78890, - "uploadId": 506596, - "answer": "1", - "sort": 0, - "reviewerUserId": 1800089, - "submitterUserId": 1800141, - "committed": 1, - "comments": null - } - ] - -+ Response 200 (application/json) - - { - "id": "4ff9fa1b:15012e95fe9:-7f8f", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": null - }, - "content": null - }, - "version": "v3" - } - -## Get scorecards [GET /scorecards/] -Fetches scorecards - -+ Parameters - - + filter (string, optional) - the filter in key=value format - * challengeId (number, optional) Id of the challenge () - * reviewId (number, optional) id of the reivew () - + limit (number, optional) Maximum number of results to be returned. Only a maximun of 50 records can be retrieved at a time (DEFAULT: 20) - + offset (number, optional) Offset to return results from (DEFAULT: 0) - -+ Response 200 (application/json) - - { - "id": "-77190b52:15039405e2d:-7fff", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": 1 - }, - "content": [ - { - "updatedAt": null, - "createdAt": null, - "createdBy": null, - "updatedBy": null, - "id": 30001821, - "name": "Swift Certification - Peer Review" - } - ] - }, - "version": "v3" - } - -## Get scorecard questions [GET /scorecardQuestions/] -Fetches scorecard questions - -+ Parameters - - + filter (string, optional) - the filter in key=value format - * scorecardId (number, optional) Id of the scorecard () - + limit (number, optional) Maximum number of results to be returned. Only a maximun of 50 records can be retrieved at a time (DEFAULT: 20) - + offset (number, optional) Offset to return results from (DEFAULT: 0) - -+ Response 200 (application/json) - - { - "id": "-77190b52:15039405e2d:-7ffe", - "result": { - "success": true, - "status": 200, - "metadata": { - "fields": null, - "totalCount": 5 - }, - "content": [ - { - "updatedAt": null, - "createdAt": null, - "createdBy": null, - "updatedBy": null, - "id": 30005883, - "description": "Quantitative Measure - Did the submitter provide code, screenshots or video of the application working and documentation?", - "guideline": "0 - Didn't provide the required submissions\n1 - Provided just the code.\n2 - Provided 2 out of the three items\n3 - Provided all 3", - "questionTypeId": 5 - }, - { - "updatedAt": null, - "createdAt": null, - "createdBy": null, - "updatedBy": null, - "id": 30005884, - "description": "Documentation Measure - Was the code well formatted with comments explaining the code well? Grade this criterion independently from functionality. In other words, if only one section is coded but it is written well and documented in a clear, convincing, and thoughtful manner, award 3 points for this portion.", - "guideline": "0 - Didn't document the code or it is completely irrelevant.\n1 - Code with no comments.\n2 - Code comments that were obvious or vague (i.e. setting X = 5 for x = 5).\n3 - Code comments that were clear, convincing, and thoughtful. ", - "questionTypeId": 5 - }, - { - "updatedAt": null, - "createdAt": null, - "createdBy": null, - "updatedBy": null, - "id": 30005885, - "description": "Qualitative Measure - Was the code well written and following best practices? Grade this criterion on implemented functionality and standards. In other words, if only one section of the application is coded but it is written well and documented in a clear, convincing, and thoughtful manner, award 3 points for this portion.", - "guideline": "0 - Didn't implement the code or it is completely irrelevant.\n1 - Code provided implements less than 60% of the required functionality or is poorly written.\n2 - Code is well written and implements between 60% and 80% of the functionality.\n3 - Code is well written and implements 80 to 100% of the functionality.", - "questionTypeId": 5 - }, - { - "updatedAt": null, - "createdAt": null, - "createdBy": null, - "updatedBy": null, - "id": 30005886, - "description": "What did you like about this submission?", - "guideline": "Rate the overall submission. What did you specifically like about this submission.", - "questionTypeId": 5 - }, - { - "updatedAt": null, - "createdAt": null, - "createdBy": null, - "updatedBy": null, - "id": 30005887, - "description": "What could be better about this submission?", - "guideline": "Rate the overall submission. What did you specifically NOT like about this submission.", - "questionTypeId": 5 - } - ] - }, - "version": "v3" - } - - - - - - - - - - diff --git a/swagger.yaml b/swagger.yaml new file mode 100644 index 0000000..79602da --- /dev/null +++ b/swagger.yaml @@ -0,0 +1,977 @@ +--- +swagger: "2.0" +info: + version: "v3" + title: "Review Service API" + description: | + Services to enable members to review assets. + It includes functionality for scorecards, scorecard questions, reviews, + review items, scoring individual reviews, aggregating review scores. + +# during production,should point to your server machine +host: api.topcoder.com +basePath: "/v3" +# during production, should use https +schemes: +- "http" +produces: +- application/json +consumes: +- application/json + +securityDefinitions: + Bearer: + type: apiKey + name: Authorization + in: header + +paths: + /reviews/{challengeId}/aggregateScores/: + put: + tags: + - review + operationId: aggregateScores + description: | + Performs score aggragation for a given challenge. + During the review process, reviewers will create multiple reviews. Each review is + individually scored at the time that it is saved. At the end of the review phase + these individual reviews need to be processed and aggregated to generate the final + score for a given submission in a given challenge, updating the scores in the + submission and generating the project result records. + security: + - Bearer: [] + parameters: + - $ref: "#/parameters/challengeIdParam" + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '404': + description: The challenge is not found + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/GenericSuccessResponse" + + /feedbacks/copilots/{handle}: + get: + tags: + - copilot + operationId: getCopilotFeedbacks + description: Get copilot feedbacks + security: + - Bearer: [] + parameters: + - $ref: "#/parameters/handleParam" + - name: offset + description: pagination offset (ex. offset=101) + in: query + required: false + type: integer + format: int32 + - name: limit + description: number of feedback records to be retrieved. If this is greater than 50, only 50 records are returned (ex. limit=50) + in: query + required: false + type: integer + format: int32 + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '404': + description: The copilot is not found + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/CopilotFeedbackListResponse" + + /reviews/{challengeId}/assignNextReview: + put: + tags: + - review + operationId: assignNextReview + description: | + For peer review challenges, assign next review will look for the next submission that the currently + logged in user has to review, and perform the association. + The review phase of the challenge must be open; + The member must have submitted to the challenge; + There must still be submissions available for the member to review. I.e. submissions of other members that the member has not yet reviewed; + If the member has 5 or more reviews, they can only start a new review if all other reviews have been submitted (committed = 1) + The response content is the new review ID. The /reviews endpoint can be used to fetch it. + security: + - Bearer: [] + parameters: + - $ref: "#/parameters/challengeIdParam" + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '404': + description: The challenge is not found + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/AssignNextReviewResponse" + + + /reviews/: + get: + tags: + - review + operationId: getReviews + description: | + Get reviews. Users may only see reviews that they created, or submitted reviews (commited = 1) + of their own submissions done by other users. + security: + - Bearer: [] + parameters: + - name: offset + description: How many records to skip + in: query + required: false + type: integer + format: int32 + - name: limit + description: How many records to return + in: query + required: false + type: integer + format: int32 + - name: filter + required: true + type: string + in: query + description: | + key=value pairs + - challengeId id of the challenge + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/ReviewListResponse" + + /reviews/{reviewId}: + get: + tags: + - review + operationId: getReview + description: | + Get specified review. Users may only see review that they created, or submitted reviews (commited = 1) + of their own submissions done by other users. + security: + - Bearer: [] + parameters: + - $ref: "#/parameters/reviewIdParam" + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '404': + description: The review is not found + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/ReviewResponse" + put: + tags: + - review + operationId: updateReview + description: | + Update specified review. Users may only update reviews that they created and have not been submitted yet (commited = 0). + The only field that can be updated is the committed field. + parameters: + - $ref: "#/parameters/reviewIdParam" + - in: body + name: body + required: true + schema: + $ref: '#/definitions/Review' + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '404': + description: The review is not found + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/GenericSuccessResponse" + + /reviewItems/: + get: + tags: + - review + operationId: getReviewItems + description: | + Fetches review items. Users may only see reviews items related to reviews that they created, + or submitted reviews (commited = 1) of their own submissions done by other users. + security: + - Bearer: [] + parameters: + - name: offset + required: false + type: string + in: query + description: Offset to return results from (DEFAULT 0) + - name: limit + required: false + type: string + in: query + description: Maximum number of results to be returned. Only a maximun of 50 records can be retrieved at a time (DEFAULT 20) + - name: filter + required: false + type: string + in: query + description: | + the filter in key=value format + - reviewId (enum[string], optional) Id of the review for which to retrieve review items () + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/ReviewItemListResponse" + + post: + tags: + - review + operationId: createReviewItems + description: | + Creates new review items + Users may only create review items related to reviews that they created and are not submitted (committed = 0). + security: + - Bearer: [] + parameters: + - in: body + name: body + required: true + schema: + type: array + items: + $ref: '#/definitions/ReviewItem' + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/CreateReviewItemsResponse" + + put: + tags: + - review + operationId: updateReviewItems + description: | + Updates new review items + Users may only update review items related to reviews that they created and are not submitted (committed = 0). + security: + - Bearer: [] + parameters: + - in: body + name: body + required: true + schema: + type: array + items: + $ref: '#/definitions/ReviewItem' + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/GenericSuccessResponse" + + /scorecards: + get: + tags: + - review + operationId: getScorecards + description: | + Fetches scorecards + security: + - Bearer: [] + parameters: + - name: offset + required: false + type: string + in: query + description: Offset to return results from (DEFAULT 0) + - name: limit + required: false + type: string + in: query + description: Maximum number of results to be returned. Only a maximun of 50 records can be retrieved at a time (DEFAULT 20) + - name: filter + required: false + type: string + in: query + description: | + the filter in key=value format + - challengeId (number, optional) Id of the challenge + - reviewId (number, optional) id of the reivew + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/ScorecardListResponse" + + /scorecardQuestions: + get: + tags: + - review + operationId: getScorecardQuestions + description: | + Fetches scorecard questions + security: + - Bearer: [] + parameters: + - name: offset + required: false + type: string + in: query + description: Offset to return results from (DEFAULT 0) + - name: limit + required: false + type: string + in: query + description: Maximum number of results to be returned. Only a maximun of 50 records can be retrieved at a time (DEFAULT 20) + - name: filter + required: false + type: string + in: query + description: | + the filter in key=value format + - scorecardId (number, optional) Id of the scorecard + responses: + '500': + description: Internal Server Error + schema: + $ref: "#/definitions/ErrorModel" + '403': + description: No permission or wrong token + schema: + $ref: "#/definitions/ErrorModel" + '200': + description: Success + schema: + $ref: "#/definitions/ScorecardQuestionListResponse" + + +parameters: + challengeIdParam: + name: challengeId + in: path + description: challenge id + required: true + type: integer + format: int64 + reviewIdParam: + name: reviewId + in: path + description: review id + required: true + type: integer + format: int64 + handleParam: + name: handle + in: path + description: user handle + required: true + type: string + + +definitions: + ResponseMetadata: + title: Metadata object for a response + type: object + properties: + totalCount: + type: integer + format: int64 + description: Total count of the objects + + ErrorModel: + type: object + properties: + id: + type: string + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + description: http status code + type: integer + format: int32 + debug: + type: object + content: + type: object + + GenericSuccessResponse: + title: generic success response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + content: + type: string + description: success message + + CreateReviewItemsResponse: + title: success response after creating review items + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + content: + type: array + items: + type: integer + format: int64 + + + AssignNextReviewResponse: + title: assign next review response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + content: + type: string + description: next review id + + ScorecardQuestionListResponse: + title: scorecard question list response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + metadata: + $ref: "#/definitions/ResponseMetadata" + content: + type: array + items: + $ref: "#/definitions/ScorecardQuestion" + + ScorecardQuestion: + type: object + properties: + id: + type: integer + format: int64 + description: the scorecard question id + description: + type: string + description: the scorecard question description + guideline: + type: string + description: the scorecard question guideline + questionTypeId: + type: integer + format: int64 + description: the scorecard question type id + createdAt: + type: string + description: Datetime (GMT) when task was created + readOnly: true + createdBy: + type: integer + format: int64 + description: READ-ONLY. User who created this task + readOnly: true + updatedAt: + type: string + description: READ-ONLY. Datetime (GMT) when task was updated + readOnly: true + updatedBy: + type: integer + format: int64 + description: READ-ONLY. User that last updated this task + readOnly: true + + ScorecardListResponse: + title: scorecard list response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + metadata: + $ref: "#/definitions/ResponseMetadata" + content: + type: array + items: + $ref: "#/definitions/Scorecard" + + Scorecard: + type: object + properties: + id: + type: integer + format: int64 + description: the scorecard id + name: + type: string + description: the scorecard name + createdAt: + type: string + description: Datetime (GMT) when task was created + readOnly: true + createdBy: + type: integer + format: int64 + description: READ-ONLY. User who created this task + readOnly: true + updatedAt: + type: string + description: READ-ONLY. Datetime (GMT) when task was updated + readOnly: true + updatedBy: + type: integer + format: int64 + description: READ-ONLY. User that last updated this task + readOnly: true + + + ReviewItemListResponse: + title: review item list response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + metadata: + $ref: "#/definitions/ResponseMetadata" + content: + type: array + items: + $ref: "#/definitions/ReviewItem" + + ReviewItem: + type: object + properties: + id: + type: integer + format: int64 + description: the review item id + reviewId: + type: integer + format: int64 + description: the review id + scorecardQuestionId: + type: integer + format: int64 + description: the scorecard question id + uploadId: + type: integer + format: int64 + description: the upload id + answer: + type: string + description: review answer + sort: + type: integer + format: int32 + description: the sort index + reviewerUserId: + type: integer + format: int64 + description: the reviewer user id + submitterUserId: + type: integer + format: int64 + description: the submitter user id + committed: + type: boolean + description: committed or not + comments: + type: array + items: + $ref: "#/definitions/ReviewItemComment" + createdAt: + type: string + description: Datetime (GMT) when task was created + readOnly: true + createdBy: + type: integer + format: int64 + description: READ-ONLY. User who created this task + readOnly: true + updatedAt: + type: string + description: READ-ONLY. Datetime (GMT) when task was updated + readOnly: true + updatedBy: + type: integer + format: int64 + description: READ-ONLY. User that last updated this task + readOnly: true + + ReviewItemComment: + type: object + properties: + id: + type: integer + format: int64 + description: the review id + resourceId: + type: integer + format: int64 + description: the resource id + reviewItemId: + type: integer + format: int64 + description: the review item id + commentTypeId: + type: integer + format: int64 + description: the comment type id + content: + type: string + description: the content + + + ReviewListResponse: + title: review list response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + metadata: + $ref: "#/definitions/ResponseMetadata" + content: + type: array + items: + $ref: "#/definitions/Review" + + ReviewResponse: + title: review response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + metadata: + $ref: "#/definitions/ResponseMetadata" + content: + $ref: "#/definitions/Review" + + Review: + type: object + properties: + id: + type: integer + format: int64 + description: the review id + resourceId: + type: integer + format: int64 + description: the resource id + submissionId: + type: integer + format: int64 + description: the submission id + projectPhaseId: + type: integer + format: int64 + description: the project phase id + scorecardId: + type: integer + format: int64 + description: the scorecard id + uploadId: + type: integer + format: int64 + description: the upload id + committed: + type: boolean + description: comitted or not + score: + type: number + format: float + description: the final score + initialScore: + type: number + format: float + description: the initial score + reviewerUserId: + type: integer + format: int64 + description: the reviewer user id + submitterUserId: + type: integer + format: int64 + description: the submitter user id + createdAt: + type: string + description: Datetime (GMT) when task was created + readOnly: true + createdBy: + type: integer + format: int64 + description: READ-ONLY. User who created this task + readOnly: true + updatedAt: + type: string + description: READ-ONLY. Datetime (GMT) when task was updated + readOnly: true + updatedBy: + type: integer + format: int64 + description: READ-ONLY. User that last updated this task + readOnly: true + + CopilotFeedbackListResponse: + title: copilot feedback list response + type: object + properties: + id: + type: string + readOnly: true + description: unique id identifying the request + version: + type: string + result: + type: object + properties: + success: + type: boolean + status: + type: string + description: http status code + metadata: + $ref: "#/definitions/ResponseMetadata" + content: + type: array + items: + $ref: "#/definitions/CopilotFeedback" + + CopilotFeedback: + type: object + properties: + userId: + type: integer + format: int64 + description: the id of user who writes the feedback + reviewText: + type: string + description: feedback text + timeRating: + type: integer + format: int64 + description: time rating + qualityRating: + type: integer + format: int64 + description: quality rating + communicationRating: + type: integer + format: int64 + description: communication rating + managementRating: + type: integer + format: int64 + description: management rating + copilotProjectId: + type: integer + format: int64 + description: copilot project id + directProjectId: + type: integer + format: int64 + description: direct project id + directProjectName: + type: string + description: direct project name + createdAt: + type: string + description: Datetime (GMT) when task was created + readOnly: true + createdBy: + type: integer + format: int64 + description: READ-ONLY. User who created this task + readOnly: true + updatedAt: + type: string + description: READ-ONLY. Datetime (GMT) when task was updated + readOnly: true + updatedBy: + type: integer + format: int64 + description: READ-ONLY. User that last updated this task + readOnly: true + + + + \ No newline at end of file