From 89ccb97df91627d48d6aa72e878de9157e93d224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20Jourdane?= Date: Wed, 27 May 2020 21:49:14 +0200 Subject: [PATCH] rename judgment to ballot --- mv-openapi.yaml | 80 +++++++++---------- ...reate-judgment.yaml => create-ballot.yaml} | 4 +- openapi/components/links/delete-ballot.yaml | 6 ++ openapi/components/links/delete-judgment.yaml | 6 -- openapi/components/links/get-ballot.yaml | 6 ++ openapi/components/links/get-judgment.yaml | 6 -- ...t-not-found.yaml => ballot-not-found.yaml} | 2 +- .../schemas/{judgment.yaml => ballot.yaml} | 0 openapi/components/schemas/candidate.yaml | 6 +- openapi/mv-openapi-root.yaml | 10 +-- openapi/paths/polls.yaml | 4 +- ...ents.yaml => polls@{poll-id}@ballots.yaml} | 16 ++-- ... polls@{poll-id}@ballots@{ballot-id}.yaml} | 16 ++-- 13 files changed, 81 insertions(+), 81 deletions(-) rename openapi/components/links/{create-judgment.yaml => create-ballot.yaml} (66%) create mode 100644 openapi/components/links/delete-ballot.yaml delete mode 100644 openapi/components/links/delete-judgment.yaml create mode 100644 openapi/components/links/get-ballot.yaml delete mode 100644 openapi/components/links/get-judgment.yaml rename openapi/components/responses/{judgment-not-found.yaml => ballot-not-found.yaml} (60%) rename openapi/components/schemas/{judgment.yaml => ballot.yaml} (100%) rename openapi/paths/{polls@{poll-id}@judgments.yaml => polls@{poll-id}@ballots.yaml} (57%) rename openapi/paths/{polls@{poll-id}@judgments@{judgment-id}.yaml => polls@{poll-id}@ballots@{ballot-id}.yaml} (53%) diff --git a/mv-openapi.yaml b/mv-openapi.yaml index 203cd40..6fbe20a 100644 --- a/mv-openapi.yaml +++ b/mv-openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Mieux Voter - description: A poll application based on Majority Judgment (MJ). + description: A poll application based on Majority Judgment. version: 1.0.1-oas3 termsOfService: 'https://github.com/MieuxVoter' contact: @@ -54,8 +54,8 @@ paths: $ref: '#/components/links/update-poll' delete-poll: $ref: '#/components/links/delete-poll' - create-judgment: - $ref: '#/components/links/create-judgment' + create-ballot: + $ref: '#/components/links/create-ballot' list-poll-results: $ref: '#/components/links/list-poll-results' '400': @@ -111,7 +111,7 @@ paths: $ref: '#/components/responses/poll-not-found' security: - pollAuth: [] - '/polls/{poll-id}/judgments': + '/polls/{poll-id}/ballots': parameters: - in: path name: poll-id @@ -119,14 +119,14 @@ paths: schema: type: string post: - operationId: create-judgment - summary: Creates a judgment + operationId: create-ballot + summary: Creates a ballot requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/judgment' + $ref: '#/components/schemas/ballot' security: - {} - judgeAuth: [] @@ -140,13 +140,13 @@ paths: properties: id: type: string - description: Id of the created judgment. + description: Id of the created ballot. links: - get-judgment: - $ref: '#/components/links/get-judgment' - delete-judgment: - $ref: '#/components/links/delete-judgment' - '/polls/{poll-id}/judgments/{judgment-id}': + get-ballot: + $ref: '#/components/links/get-ballot' + delete-ballot: + $ref: '#/components/links/delete-ballot' + '/polls/{poll-id}/ballots/{ballot-id}': parameters: - in: path name: poll-id @@ -154,28 +154,28 @@ paths: schema: type: string - in: path - name: judgment-id + name: ballot-id required: true schema: type: string get: - operationId: get-judgment - summary: Gets a judgment by ID + operationId: get-ballot + summary: Gets a ballot by ID responses: '200': - description: A judgment object + description: A ballot object content: application/json: schema: - $ref: '#/components/schemas/judgment' + $ref: '#/components/schemas/ballot' delete: - operationId: delete-judgment - summary: Deletes a judgment + operationId: delete-ballot + summary: Deletes a ballot responses: '200': description: OK '404': - $ref: '#/components/responses/judgment-not-found' + $ref: '#/components/responses/ballot-not-found' security: - judgeAuth: [] '/polls/{poll-id}/judges': @@ -265,7 +265,7 @@ components: type: http scheme: bearer schemas: - judgment: + ballot: type: object properties: id: @@ -291,11 +291,11 @@ components: type: string description: Unique but short name of the candidate. example: A new school - judgments: + ballots: type: array - description: The judgments received by this candidate. + description: The ballots received by this candidate. items: - $ref: '#/components/schemas/judgment' + $ref: '#/components/schemas/ballot' grade: type: object properties: @@ -423,13 +423,13 @@ components: description: > The `id` value returned in the response can be used as the `poll-id` parameter in DELETE /polls/{poll-id}. - create-judgment: - operationId: create-judgment + create-ballot: + operationId: create-ballot parameters: userId: $response.body#/id description: > The `id` value returned in the response can be used as the `poll-id` - parameter in POST /polls/{poll-id}/judgments. + parameter in POST /polls/{poll-id}/ballots. list-poll-results: operationId: list-poll-results parameters: @@ -437,20 +437,20 @@ components: description: > The `id` value returned in the response can be used as the `poll-id` parameter in GET /polls/{poll-id}/results. - get-judgment: - operationId: get-judgment + get-ballot: + operationId: get-ballot parameters: - judgmentId: $response.body#/id + ballotId: $response.body#/id description: > - The `id` value returned in the response can be used as the `judgment-id` - parameter in GET /polls/{poll-id}/judgments/{judgment-id}. - delete-judgment: - operationId: delete-judgment + The `id` value returned in the response can be used as the `ballot-id` + parameter in GET /polls/{poll-id}/ballots/{ballot-id}. + delete-ballot: + operationId: delete-ballot parameters: - judgmentId: $response.body#/id + ballotId: $response.body#/id description: > - The `id` value returned in the response can be used as the `judgment-id` - parameter in DELETE /polls/{poll-id}/judgments/{judgment-id}. + The `id` value returned in the response can be used as the `ballot-id` + parameter in DELETE /polls/{poll-id}/ballots/{ballot-id}. responses: poll-not-found: description: The specified poll was not found @@ -458,8 +458,8 @@ components: application/json: schema: $ref: '#/components/schemas/error' - judgment-not-found: - description: The specified judgment was not found + ballot-not-found: + description: The specified ballot was not found content: application/json: schema: diff --git a/openapi/components/links/create-judgment.yaml b/openapi/components/links/create-ballot.yaml similarity index 66% rename from openapi/components/links/create-judgment.yaml rename to openapi/components/links/create-ballot.yaml index 6ccc161..d54ad25 100644 --- a/openapi/components/links/create-judgment.yaml +++ b/openapi/components/links/create-ballot.yaml @@ -1,6 +1,6 @@ -operationId: 'create-judgment' +operationId: 'create-ballot' parameters: userId: $response.body#/id description: > The `id` value returned in the response can be used as the `poll-id` parameter - in POST /polls/{poll-id}/judgments. + in POST /polls/{poll-id}/ballots. diff --git a/openapi/components/links/delete-ballot.yaml b/openapi/components/links/delete-ballot.yaml new file mode 100644 index 0000000..ef0d3b3 --- /dev/null +++ b/openapi/components/links/delete-ballot.yaml @@ -0,0 +1,6 @@ +operationId: 'delete-ballot' +parameters: + ballotId: $response.body#/id +description: > + The `id` value returned in the response can be used as the `ballot-id` + parameter in DELETE /polls/{poll-id}/ballots/{ballot-id}. diff --git a/openapi/components/links/delete-judgment.yaml b/openapi/components/links/delete-judgment.yaml deleted file mode 100644 index e712e4a..0000000 --- a/openapi/components/links/delete-judgment.yaml +++ /dev/null @@ -1,6 +0,0 @@ -operationId: 'delete-judgment' -parameters: - judgmentId: $response.body#/id -description: > - The `id` value returned in the response can be used as the `judgment-id` - parameter in DELETE /polls/{poll-id}/judgments/{judgment-id}. diff --git a/openapi/components/links/get-ballot.yaml b/openapi/components/links/get-ballot.yaml new file mode 100644 index 0000000..f1bde6d --- /dev/null +++ b/openapi/components/links/get-ballot.yaml @@ -0,0 +1,6 @@ +operationId: 'get-ballot' +parameters: + ballotId: $response.body#/id +description: > + The `id` value returned in the response can be used as the `ballot-id` + parameter in GET /polls/{poll-id}/ballots/{ballot-id}. diff --git a/openapi/components/links/get-judgment.yaml b/openapi/components/links/get-judgment.yaml deleted file mode 100644 index b52f5d4..0000000 --- a/openapi/components/links/get-judgment.yaml +++ /dev/null @@ -1,6 +0,0 @@ -operationId: 'get-judgment' -parameters: - judgmentId: $response.body#/id -description: > - The `id` value returned in the response can be used as the `judgment-id` - parameter in GET /polls/{poll-id}/judgments/{judgment-id}. diff --git a/openapi/components/responses/judgment-not-found.yaml b/openapi/components/responses/ballot-not-found.yaml similarity index 60% rename from openapi/components/responses/judgment-not-found.yaml rename to openapi/components/responses/ballot-not-found.yaml index 6652d14..e98c180 100644 --- a/openapi/components/responses/judgment-not-found.yaml +++ b/openapi/components/responses/ballot-not-found.yaml @@ -1,4 +1,4 @@ -description: The specified judgment was not found +description: The specified ballot was not found content: application/json: schema: diff --git a/openapi/components/schemas/judgment.yaml b/openapi/components/schemas/ballot.yaml similarity index 100% rename from openapi/components/schemas/judgment.yaml rename to openapi/components/schemas/ballot.yaml diff --git a/openapi/components/schemas/candidate.yaml b/openapi/components/schemas/candidate.yaml index 90842af..4f5f78b 100644 --- a/openapi/components/schemas/candidate.yaml +++ b/openapi/components/schemas/candidate.yaml @@ -9,8 +9,8 @@ properties: type: string description: Unique but short name of the candidate. example: A new school - judgments: + ballots: type: array - description: The judgments received by this candidate. + description: The ballots received by this candidate. items: - $ref: ./judgment.yaml + $ref: ./ballot.yaml diff --git a/openapi/mv-openapi-root.yaml b/openapi/mv-openapi-root.yaml index 2ac6f07..cae3d57 100644 --- a/openapi/mv-openapi-root.yaml +++ b/openapi/mv-openapi-root.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Mieux Voter - description: A poll application based on Majority Judgment (MJ). + description: A poll application based on Majority Judgment. version: 1.0.1-oas3 termsOfService: 'https://github.com/MieuxVoter' contact: @@ -17,10 +17,10 @@ paths: $ref: paths/polls.yaml '/polls/{poll-id}': $ref: 'paths/polls@{poll-id}.yaml' - '/polls/{poll-id}/judgments': - $ref: 'paths/polls@{poll-id}@judgments.yaml' - '/polls/{poll-id}/judgments/{judgment-id}': - $ref: 'paths/polls@{poll-id}@judgments@{judgment-id}.yaml' + '/polls/{poll-id}/ballots': + $ref: 'paths/polls@{poll-id}@ballots.yaml' + '/polls/{poll-id}/ballots/{ballot-id}': + $ref: 'paths/polls@{poll-id}@ballots@{ballot-id}.yaml' '/polls/{poll-id}/judges': $ref: 'paths/polls@{poll-id}@judges.yaml' '/polls/{poll-id}/judges/{judge-id}/': diff --git a/openapi/paths/polls.yaml b/openapi/paths/polls.yaml index 4dfdab0..83c0663 100644 --- a/openapi/paths/polls.yaml +++ b/openapi/paths/polls.yaml @@ -37,8 +37,8 @@ post: $ref: ../components/links/update-poll.yaml delete-poll: $ref: ../components/links/delete-poll.yaml - create-judgment: - $ref: ../components/links/create-judgment.yaml + create-ballot: + $ref: ../components/links/create-ballot.yaml list-poll-results: $ref: ../components/links/list-poll-results.yaml '400': diff --git a/openapi/paths/polls@{poll-id}@judgments.yaml b/openapi/paths/polls@{poll-id}@ballots.yaml similarity index 57% rename from openapi/paths/polls@{poll-id}@judgments.yaml rename to openapi/paths/polls@{poll-id}@ballots.yaml index 5f8eebd..66e4f19 100644 --- a/openapi/paths/polls@{poll-id}@judgments.yaml +++ b/openapi/paths/polls@{poll-id}@ballots.yaml @@ -5,14 +5,14 @@ parameters: schema: type: string post: - operationId: create-judgment - summary: Creates a judgment + operationId: create-ballot + summary: Creates a ballot requestBody: required: true content: application/json: schema: - $ref: ../components/schemas/judgment.yaml + $ref: ../components/schemas/ballot.yaml security: - {} - judgeAuth: [] @@ -26,9 +26,9 @@ post: properties: id: type: string - description: Id of the created judgment. + description: Id of the created ballot. links: - get-judgment: - $ref: ../components/links/get-judgment.yaml - delete-judgment: - $ref: ../components/links/delete-judgment.yaml + get-ballot: + $ref: ../components/links/get-ballot.yaml + delete-ballot: + $ref: ../components/links/delete-ballot.yaml diff --git a/openapi/paths/polls@{poll-id}@judgments@{judgment-id}.yaml b/openapi/paths/polls@{poll-id}@ballots@{ballot-id}.yaml similarity index 53% rename from openapi/paths/polls@{poll-id}@judgments@{judgment-id}.yaml rename to openapi/paths/polls@{poll-id}@ballots@{ballot-id}.yaml index 7c7b116..2dfa66b 100644 --- a/openapi/paths/polls@{poll-id}@judgments@{judgment-id}.yaml +++ b/openapi/paths/polls@{poll-id}@ballots@{ballot-id}.yaml @@ -5,27 +5,27 @@ parameters: schema: type: string - in: path - name: judgment-id + name: ballot-id required: true schema: type: string get: - operationId: get-judgment - summary: Gets a judgment by ID + operationId: get-ballot + summary: Gets a ballot by ID responses: '200': - description: A judgment object + description: A ballot object content: application/json: schema: - $ref: ../components/schemas/judgment.yaml + $ref: ../components/schemas/ballot.yaml delete: - operationId: delete-judgment - summary: Deletes a judgment + operationId: delete-ballot + summary: Deletes a ballot responses: '200': description: OK '404': - $ref: ../components/responses/judgment-not-found.yaml + $ref: ../components/responses/ballot-not-found.yaml security: - judgeAuth: []