Skip to content

Commit

Permalink
QuestionnaireListに統一
Browse files Browse the repository at this point in the history
  • Loading branch information
reiroop committed Dec 9, 2023
1 parent 85d6e43 commit 64d72c6
Showing 1 changed file with 32 additions and 72 deletions.
104 changes: 32 additions & 72 deletions docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/QuestionnairesWithPageMax"
$ref: "#/components/schemas/QuestionnaireList"
"400":
description: 与えられた情報の形式が異なります
"500":
Expand Down Expand Up @@ -84,7 +84,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/QuestionnaireByID"
$ref: "#/components/schemas/QuestionnaireList"
"400":
description: アンケートのIDが無効です
"404":
Expand Down Expand Up @@ -378,7 +378,7 @@ paths:
schema:
type: array
items:
$ref: "#/components/schemas/QuestionnaireMyTargeted"
$ref: "#/components/schemas/QuestionnaireList"
"500":
description: 自分のUserIDが取得できませんでした
/users/{traQID}/targeted:
Expand All @@ -399,7 +399,7 @@ paths:
schema:
type: array
items:
$ref: "#/components/schemas/QuestionnaireMyTargeted"
$ref: "#/components/schemas/QuestionnaireList"
"400":
description: 与えらえた情報の形式が異なります
"500":
Expand All @@ -418,7 +418,7 @@ paths:
schema:
type: array
items:
$ref: "#/components/schemas/QuestionnaireMyAdministrates"
$ref: "#/components/schemas/QuestionnaireList"
"500":
description: 自分が管理者となっているアンケートのリストを取得できませんでした
/groups:
Expand Down Expand Up @@ -586,11 +586,11 @@ components:
type: string
example: public
enum:
- administrators
- admins
- respondents
- public
description: |
アンケートの結果を, 運営は見られる ("administrators"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public")
アンケートの結果を, 運営は見られる ("admins"), 回答済みの人は見られる ("respondents") 誰でも見られる ("public")
NewQuestionnaire:
allOf:
- $ref: "#/components/schemas/QuestionnaireTitle"
Expand All @@ -600,13 +600,13 @@ components:
- $ref: "#/components/schemas/QuestionnaireIsAnonymous"
- $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses"
- $ref: "#/components/schemas/QuestionnaireIsPublished"
- $ref: "#/components/schemas/QuestionnaireTargets"
- $ref: "#/components/schemas/QuestionnaireAdministrators"
- $ref: "#/components/schemas/QuestionnaireQuestions"
- $ref: "#/components/schemas/QuestionnaireTargetsAndAdmins"
- $ref: "#/components/schemas/Questions"
QuestionnaireDetail:
allOf:
- $ref: "#/components/schemas/QuestionnaireID"
- $ref: "#/components/schemas/NewQuestionnaire"
- $ref: "#/components/schemas/QuestionnaireRespondents"
- $ref: "#/components/schemas/QuestionnaireCreatedAt"
- $ref: "#/components/schemas/QuestionnaireModifiedAt"
QuestionnaireSummary:
Expand All @@ -619,72 +619,36 @@ components:
- $ref: "#/components/schemas/QuestionnaireIsAnonymous"
- $ref: "#/components/schemas/QuestionnaireAllowsMultipleResponses"
- $ref: "#/components/schemas/QuestionnaireIsPublished"
QuestionnaireForList:
allOf:
- $ref: "#/components/schemas/QuestionnaireSummary"
- type: object
properties:
is_targeted:
- properties:
is_targeting_me:
type: boolean
example: true
description: |
自分がターゲットになっているかどうか
required:
- is_targeted
QuestionnairesWithPageMax:
type: object
properties:
page_max:
type: integer
description: 最大ページ数
questionnaires:
type: array
items:
$ref: "#/components/schemas/QuestionnaireSummary"
required:
- page_max
- questionnaires
QuestionnaireByID:
allOf:
- $ref: "#/components/schemas/QuestionnaireDetail"
- type: object
properties:
respondents:
$ref: "#/components/schemas/Users"
required:
- respondents
QuestionnaireMyTargeted:
allOf:
- $ref: "#/components/schemas/QuestionnaireSummary"
- type: object
properties:
responded_at:
type: string
format: date-time
has_response:
has_my_draft:
type: boolean
description: 回答済みあるいは下書きが存在する
required:
- responded_at
- has_response
QuestionnaireMyAdministrates:
allOf:
- $ref: "#/components/schemas/QuestionnaireDetail"
- type: object
properties:
description: 下書きが存在する
has_my_response:
type: boolean
description: 回答が存在する
all_responded:
type: boolean
example: true
description: |
回答必須でない場合、またはすべてのターゲットが回答済みの場合、true を返す。それ以外はfalseを返す。
respondents:
$ref: "#/components/schemas/Users"
required:
- is_targeting_me
- responded_at
- has_my_draft
- has_my_response
- all_responded
- respondents
QuestionnaireUser:
allOf:
- $ref: "#/components/schemas/QuestionnaireDetail"
QuestionnaireList:
type: array
items:
$ref: "#/components/schemas/QuestionnaireSummary"

# TODO: exampleを追加する
NewQuestion:
Expand Down Expand Up @@ -1059,10 +1023,13 @@ components:
format: date-time
required:
- modified_at
QuestionnaireTargets:
$ref: "#/components/schemas/UsersAndGroups"
QuestionnaireAdministrators:
$ref: "#/components/schemas/UsersAndGroups"
QuestionnaireTargetsAndAdmins:
type: object
properties:
targets:
$ref: "#/components/schemas/UsersAndGroups"
admins:
$ref: "#/components/schemas/UsersAndGroups"
QuestionnaireAllResponded:
type: object
properties:
Expand Down Expand Up @@ -1091,13 +1058,6 @@ components:
description: 回答済みあるいは下書きが存在する
required:
- has_response
QuestionnaireQuestions:
type: object
properties:
questions:
type: array
items:
$ref: "#/components/schemas/Question"
UsersAndGroups:
type: object
properties:
Expand Down

0 comments on commit 64d72c6

Please sign in to comment.