Skip to content

Commit

Permalink
questionを整理
Browse files Browse the repository at this point in the history
  • Loading branch information
reiroop committed Dec 9, 2023
1 parent 0715cc1 commit 85d6e43
Showing 1 changed file with 92 additions and 94 deletions.
186 changes: 92 additions & 94 deletions docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ paths:
schema:
type: array
items:
$ref: "#/components/schemas/QuestionDetails"
$ref: "#/components/schemas/Question"
"400":
description: アンケートのIDが無効です
"500":
Expand Down Expand Up @@ -621,7 +621,7 @@ components:
- $ref: "#/components/schemas/QuestionnaireIsPublished"
QuestionnaireForList:
allOf:
- $ref: "#/components/schemas/Questionnaire"
- $ref: "#/components/schemas/QuestionnaireSummary"
- type: object
properties:
is_targeted:
Expand Down Expand Up @@ -655,7 +655,7 @@ components:
- respondents
QuestionnaireMyTargeted:
allOf:
- $ref: "#/components/schemas/Questionnaire"
- $ref: "#/components/schemas/QuestionnaireSummary"
- type: object
properties:
responded_at:
Expand Down Expand Up @@ -685,103 +685,17 @@ components:
QuestionnaireUser:
allOf:
- $ref: "#/components/schemas/QuestionnaireDetail"
QuestionType:
type: string
example: Text
enum:
- Text
- TextArea
- Number
- MultipleChoice
- Checkbox
- LinearScale
description: |
どのタイプの質問か ("Text", "TextArea", "Number", "MultipleChoice", "Checkbox", "LinearScale")
QuestionBase:
type: object
properties:
page_num:
type: integer
example: 1
description: |
アンケートの何ページ目の質問か
question_num:
type: integer
example: 1
description: |
アンケートの質問のうち、何問目か
question_type:
$ref: "#/components/schemas/QuestionType"
body:
type: string
example: 質問文
is_required:
type: boolean
example: true
description: |
回答必須かどうか
options:
type: array
items:
type: string
example: 選択肢1
scale_label_right:
type: string
example: そう思わない
scale_label_left:
type: string
example: そう思う
scale_min:
type: integer
example: 1
scale_max:
type: integer
example: 5
regex_pattern:
type: string
example: ""
min_bound:
type: string
example: ""
max_bound:
type: string
example: ""
required:
- page_num
- question_num
- question_type
- body
- is_required
- options
- scale_label_right
- scale_label_left
- scale_min
- scale_max

# TODO: exampleを追加する
NewQuestion:
allOf:
- $ref: "#/components/schemas/QuestionBase"
- type: object
properties:
questionnaireID:
type: integer
example: 1
required:
- questionnaireID
- $ref: "#/components/schemas/QuestionSettingsByType"
Question:
allOf:
- $ref: "#/components/schemas/NewQuestion"
- type: object
properties:
questionID:
type: integer
example: 1
required:
- questionID
QuestionDetails:
allOf:
- $ref: "#/components/schemas/QuestionBase"
- type: object
properties:
- $ref: "#/components/schemas/QuestionSettingsByType"
- properties:
questionID:
type: integer
example: 1
Expand All @@ -791,6 +705,89 @@ components:
required:
- questionID
- created_at
Questions:
type: array
items:
$ref: "#/components/schemas/Question"
QuestionBase:
type: object
properties:
questionnaireID:
type: integer
example: 1
questionType:
$ref: "#/components/schemas/QuestionType"
title:
type: string
description:
type: string
is_required:
type: boolean
required:
- questionType
- title
- description
- is_required
- questionnaireID
QuestionSettingsByType:
oneOf:
- $ref: "#/components/schemas/QuestionSettingsText"
- $ref: "#/components/schemas/QuestionSettingsTextLong"
- $ref: "#/components/schemas/QuestionSettingsNumber"
- $ref: "#/components/schemas/QuestionSettingsSingleChoice"
- $ref: "#/components/schemas/QuestionSettingsMultipleChoice"
- $ref: "#/components/schemas/QuestionSettingsScale"
QuestionSettingsText:
type: object
properties:
maxLength:
type: integer
QuestionSettingsTextLong:
type: object
properties:
maxLength:
type: number
QuestionSettingsNumber:
type: object
properties:
minValue:
type: integer
maxValue:
type: integer
QuestionSettingsSingleChoice:
type: object
properties:
options:
type: array
items:
type: string
QuestionSettingsMultipleChoice:
type: object
properties:
options:
type: array
items:
type: string
QuestionSettingsScale:
type: object
properties:
minValue:
type: integer
maxValue:
type: integer
QuestionType:
type: string
example: Text
enum:
- Text
- TextArea
- Number
- MultipleChoice
- Checkbox
- LinearScale
description: |
どのタイプの質問か ("Text", "TextLong", "Number", "SingleChoice", "MultipleChoice", "Scale")
NewResponse:
type: object
properties:
Expand Down Expand Up @@ -1121,6 +1118,7 @@ components:
items:
type: string
example: executive24

securitySchemes:
application:
type: oauth2
Expand Down

0 comments on commit 85d6e43

Please sign in to comment.