openapi: 3.1.0 info: title: 1m26_11 API version: 1.0.0 description: | フロントエンドとバックエンドが共有するAPI契約です。 room_idとproblem_idに記載したUUIDは契約例であり、開始導線の実IDではありません。 paths: /openapi.yaml: get: summary: OpenAPI文書を取得する operationId: getOpenApi tags: - tooling responses: "200": description: このserver buildが使用するOpenAPI文書 content: application/yaml: schema: type: string /api/me: get: summary: ログイン状態を取得する operationId: getMe tags: - auth responses: "200": $ref: "#/components/responses/MeSuccess" "500": $ref: "#/components/responses/InternalServerError" /api/me/progress: get: summary: ログイン中のユーザーの全体進捗を取得する description: | 公開room全体のclear数、総数、genre別内訳を返します。 同じroomを複数回clearしていても、clear数には1回だけ加算します。 非公開roomは全体とgenre別のどちらにも含めません。 by_genreはgenreの昇順で返します。 operationId: getMeProgress tags: - progress responses: "200": $ref: "#/components/responses/MeProgressSuccess" "401": $ref: "#/components/responses/Unauthorized" "500": $ref: "#/components/responses/InternalServerError" /api/auth/guest: post: summary: デモ環境で名前を登録する description: AUTH_MODE=demoのときだけ有効です。NeoShowcase modeでは404を返します。 operationId: loginGuest tags: - auth requestBody: $ref: "#/components/requestBodies/GuestLogin" responses: "200": $ref: "#/components/responses/GuestLoginSuccess" "400": $ref: "#/components/responses/BadRequest" "404": $ref: "#/components/responses/NotFound" "422": $ref: "#/components/responses/GuestLoginValidationError" "500": $ref: "#/components/responses/InternalServerError" /api/auth/logout: post: summary: デモ環境からログアウトする description: AUTH_MODE=demoのときだけ使用し、デモsessionとCookieを無効化します。NeoShowcase modeでは404を返します。 operationId: logoutDemo tags: - auth responses: "204": description: ログアウト完了。response bodyはありません。 headers: Set-Cookie: description: demo_session Cookieを削除します。Path=/、Max-Age=0、過去のExpiresを指定し、デプロイ環境ではSecureを付けます。 schema: type: string "404": $ref: "#/components/responses/NotFound" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}: parameters: - $ref: "#/components/parameters/RoomId" get: summary: 部屋詳細を取得する description: | 公開されている部屋の基本情報、問題数、現在のユーザーの挑戦状態、およびランキング概要を取得します。 未認証、または未挑戦の場合は run_status は not_started となり、my_rank は null になります。 operationId: getRoom tags: - rooms responses: "200": $ref: "#/components/responses/RoomSuccess" "400": $ref: "#/components/responses/BadRequest" "404": $ref: "#/components/responses/NotFound" "500": $ref: "#/components/responses/InternalServerError" /api/rooms: get: summary: 公開部屋一覧を取得する description: | 公開されている部屋の一覧をnumber昇順で取得します。 未認証時は進捗がnot_started、best_recordがnullで返ります。 認証時は現在のユーザーの進捗とベストレコードを含めて返します。 operationId: getRooms tags: - rooms responses: "200": $ref: "#/components/responses/RoomsSuccess" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}/runs: parameters: - $ref: "#/components/parameters/RoomId" post: summary: 挑戦を開始または再開する description: | 認証済みユーザーとroom_idからactiveなrunを検索します。 request bodyは使用しません。 activeなrunがあれば再開します。 未挑戦なら新規runをserver時刻で作成します。 クリア済みの場合は再挑戦を開始せず409を返します。 operationId: startOrResumeRun tags: - runs responses: "200": $ref: "#/components/responses/RunStartOrResumeSuccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" "409": description: この部屋をクリア済みのため再挑戦できません content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}/runs/current: parameters: - $ref: "#/components/parameters/RoomId" get: summary: 現在の挑戦状態を取得する operationId: getCurrentRun tags: - runs responses: "200": $ref: "#/components/responses/CurrentRunSuccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/RunNotFound" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}/leaderboard: parameters: - $ref: "#/components/parameters/RoomId" get: summary: 部屋別leaderboardを取得する description: | roomごとに、clear済みrunからユーザーごとのbest recordを1件ずつ返します。 同一ユーザーのbest recordはelapsed_ms、query_count、cleared_atの昇順で選びます。 leaderboardもelapsed_ms、query_count、cleared_atの昇順で並べます。 3項目がすべて同じrecordには同じrankを付け、次のrankを飛ばします(1, 1, 3)。 query_countにはoperation_sequence型問題の試行回数だけを含めます。 未認証、または現在のユーザーにclear recordがない場合はmeをnullにします。 operationId: getRoomLeaderboard tags: - leaderboard responses: "200": $ref: "#/components/responses/LeaderboardSuccess" "400": $ref: "#/components/responses/BadRequest" "404": $ref: "#/components/responses/NotFound" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}/problems: parameters: - $ref: "#/components/parameters/RoomId" get: summary: 挑戦中の部屋の問題一覧を取得する description: | 認証済みユーザーのactive runに属する問題をnumber昇順で返します。 locked状態の問題もid、number、title、statusを返します。 問題文、入力設定、ヒント、画像、正解、判定設定は返しません。 operationId: getProblems tags: - problems responses: "200": $ref: "#/components/responses/ProblemsSuccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/RunNotFound" "500": $ref: "#/components/responses/InternalServerError" post: summary: 作問用の問題を新規作成する description: | dev環境専用の作問支援APIです。 AUTH_MODE=demoかつPROBLEM_AUTHORING_ENABLED=trueの場合だけrouteを登録します。 それ以外の環境ではroute自体を登録せず404を返します。 serverがproblem_idを生成し、指定された未公開roomへ問題を追加します。 画像はこのrequestへ含めず、作成後にuploadProblemAssetを使用します。 operationId: createProblem tags: - problems parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: $ref: "#/components/requestBodies/CreateProblem" responses: "201": $ref: "#/components/responses/ProblemCreateSuccess" "400": $ref: "#/components/responses/ProblemCreateBadRequest" "404": $ref: "#/components/responses/ProblemCreateNotFound" "409": $ref: "#/components/responses/ProblemCreateConflict" "422": $ref: "#/components/responses/ProblemCreateValidationError" "500": $ref: "#/components/responses/ProblemCreateInternalServerError" /api/rooms/{room_id}/problems/{problem_id}: parameters: - $ref: "#/components/parameters/RoomId" - $ref: "#/components/parameters/ProblemId" get: summary: 問題データを取得する description: 正解、全候補、判定設定、ヒント本文は返しません。 operationId: getProblem tags: - problems responses: "200": $ref: "#/components/responses/ProblemSuccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" "409": $ref: "#/components/responses/ProblemLocked" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}/problems/{problem_id}/assets: parameters: - $ref: "#/components/parameters/RoomId" - $ref: "#/components/parameters/ProblemId" get: summary: 問題に登録された画像の取得URLを発行する description: | 認証済みユーザーのcurrent runで解放済みのproblemに登録された画像を返します。 IMAGE_DOWNLOAD_ENABLED=trueの場合だけrouteを登録します。 無効な場合はroute自体を登録せず404を返します。 各Assetのurlは、storage objectをGETするためのpresigned URLです。 presigned URLの有効期限は発行から300秒です。 requestからobject_keyは受け取らず、problems.assetsに登録されたobject_keyだけを署名します。 responseへstorage credentialや内部object_keyは返しません。 operationId: getProblemAssets tags: - problems responses: "200": $ref: "#/components/responses/ProblemAssetsSuccess" "400": $ref: "#/components/responses/ProblemAssetsBadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/ProblemAssetsNotFound" "409": $ref: "#/components/responses/ProblemLocked" "500": $ref: "#/components/responses/ProblemAssetsInternalServerError" post: summary: 作問用画像をアップロードする description: | dev環境専用の作問支援APIです。 AUTH_MODE=demoかつIMAGE_UPLOAD_ENABLED=trueの場合だけrouteを登録します。 それ以外の環境ではroute自体を登録せず404を返します。 fileの実内容を検査し、storageへのuploadとproblems.assetsへの追加を行います。 client filename、object_key、storage credentialはresponseへ返しません。 operationId: uploadProblemAsset tags: - problems parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: $ref: "#/components/requestBodies/UploadProblemAsset" responses: "201": $ref: "#/components/responses/ProblemAssetUploadSuccess" "400": $ref: "#/components/responses/ProblemAssetUploadBadRequest" "404": $ref: "#/components/responses/ProblemAssetUploadNotFound" "409": $ref: "#/components/responses/ProblemAssetUploadConflict" "413": $ref: "#/components/responses/ProblemAssetUploadTooLarge" "415": $ref: "#/components/responses/ProblemAssetUploadUnsupportedMediaType" "422": $ref: "#/components/responses/ProblemAssetUploadValidationError" "500": $ref: "#/components/responses/ProblemAssetUploadInternalServerError" "502": $ref: "#/components/responses/ProblemAssetUploadProviderError" "503": $ref: "#/components/responses/ProblemAssetUploadUnavailable" /api/rooms/{room_id}/problems/{problem_id}/hints/{level}: parameters: - $ref: "#/components/parameters/RoomId" - $ref: "#/components/parameters/ProblemId" - $ref: "#/components/parameters/HintLevel" get: summary: 問題のヒントを取得する description: 認証済みユーザーのcurrent runで、指定されたlevelのヒントを取得します。 operationId: getProblemHint tags: - problems responses: "200": $ref: "#/components/responses/ProblemHintSuccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" "409": $ref: "#/components/responses/ProblemLocked" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}/problems/{problem_id}/queries: parameters: - $ref: "#/components/parameters/RoomId" - $ref: "#/components/parameters/ProblemId" post: summary: 絞り込み操作列を送信する description: 操作列全体を一度に送り、不正解も200とcorrect=falseで返します。 operationId: submitQuery tags: - queries requestBody: $ref: "#/components/requestBodies/SubmitQuery" responses: "200": $ref: "#/components/responses/QuerySuccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" "409": $ref: "#/components/responses/QueryConflict" "422": $ref: "#/components/responses/QueryValidationError" "500": $ref: "#/components/responses/InternalServerError" /api/rooms/{room_id}/problems/{problem_id}/answers: parameters: - $ref: "#/components/parameters/RoomId" - $ref: "#/components/parameters/ProblemId" post: summary: 文字列回答を送信する description: 不正解も200とcorrect=falseで返します。 operationId: submitAnswer tags: - answers requestBody: $ref: "#/components/requestBodies/SubmitAnswer" responses: "200": $ref: "#/components/responses/AnswerSuccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" "409": $ref: "#/components/responses/AnswerConflict" "422": $ref: "#/components/responses/UnprocessableEntity" "500": $ref: "#/components/responses/InternalServerError" components: parameters: RoomId: name: room_id in: path required: true description: | 部屋のUUID。下記は契約用例示値であり、開始導線の実room_idではありません。 schema: type: string format: uuid example: 11111111-1111-4111-8111-111111111111 ProblemId: name: problem_id in: path required: true description: | 問題のUUID。下記は契約用例示値であり、開始導線の実problem_idではありません。 schema: type: string format: uuid example: 22222222-2222-4222-8222-222222222221 HintLevel: name: level in: path required: true description: ヒントの段階(1以上の整数) schema: type: integer minimum: 1 example: 1 IdempotencyKey: name: Idempotency-Key in: header required: true description: | methodとpathごとにrequestを識別するUUID v4です。 同じrequest内容による再送では、最初の成功responseを返します。 同じkeyを異なるrequest内容へ再利用した場合は409を返します。 schema: type: string format: uuid example: 44444444-4444-4444-8444-444444444444 requestBodies: GuestLogin: required: true content: application/json: schema: $ref: "#/components/schemas/GuestLoginRequest" examples: guest_login: summary: デモ用の名前登録 externalValue: ./examples/auth/guest-request.json guest_login_empty: summary: trim後に空となる表示名 externalValue: ./examples/auth/guest-request-empty.json guest_login_too_long: summary: trim後に33 Unicode code pointとなる表示名 externalValue: ./examples/auth/guest-request-too-long.json SubmitQuery: required: true content: application/json: schema: $ref: "#/components/schemas/QueryRequest" examples: serial_operations: summary: シリアル入力から作った操作列 externalValue: ./examples/queries/request-serial.json invalid_source: summary: 許可されていない入力元 externalValue: ./examples/queries/request-invalid-source.json SubmitAnswer: required: true content: application/json: schema: $ref: "#/components/schemas/AnswerRequest" examples: submitted_answer: summary: 文字列回答 externalValue: ./examples/answers/request.json too_long_for_example_problem: summary: max_lengthが50の例示問題に対する51文字の入力 externalValue: ./examples/answers/request-too-long.json CreateProblem: required: true content: application/json: schema: $ref: "#/components/schemas/CreateProblemRequest" examples: operation_sequence: summary: 操作列問題を作成する externalValue: ./examples/problems/create-operation-sequence-request.json string: summary: 文字列回答問題を作成する externalValue: ./examples/problems/create-string-request.json UploadProblemAsset: required: true content: multipart/form-data: schema: type: object required: - file - alt properties: file: type: string format: binary description: | 5,242,880 bytes以下のPNG、JPEG、WebP画像です。 filenameや申告Content-Typeではなく実内容を検証します。 alt: type: string description: | 画像内容を説明する代替テキストです。 Unicode空白を前後からtrimした後、1〜200文字である必要があります。 responses: MeSuccess: description: 現在のログイン状態 content: application/json: schema: $ref: "#/components/schemas/MeResponse" examples: neoshowcase_authenticated: summary: NeoShowcaseでログイン済み externalValue: ./examples/auth/me-neoshowcase-authenticated.json neoshowcase_unauthenticated: summary: NeoShowcaseで未ログイン externalValue: ./examples/auth/me-neoshowcase-unauthenticated.json demo_authenticated: summary: デモでログイン済み externalValue: ./examples/auth/me-demo-authenticated.json demo_unauthenticated: summary: デモで未ログイン externalValue: ./examples/auth/me-demo-unauthenticated.json RoomsSuccess: description: 公開部屋一覧の取得成功 content: application/json: schema: $ref: "#/components/schemas/RoomsResponse" examples: authenticated_cleared: summary: 認証済みユーザー・部屋クリア済み externalValue: ./examples/rooms/response-authenticated-cleared.json authenticated_active: summary: 認証済みユーザー・挑戦中 externalValue: ./examples/rooms/response-authenticated-active.json unauthenticated: summary: 未ログイン externalValue: ./examples/rooms/response-unauthenticated.json empty: summary: 公開部屋が0件 externalValue: ./examples/rooms/response-empty.json MeProgressSuccess: description: ログイン中のユーザーの公開room全体に対する進捗 content: application/json: schema: $ref: "#/components/schemas/MeProgressResponse" examples: summary: summary: 複数genreのroomをclearしている場合 externalValue: ./examples/progress/response-summary.json empty: summary: 公開roomが存在しない場合 externalValue: ./examples/progress/response-empty.json GuestLoginSuccess: description: デモ用ユーザーを取得または作成し、session Cookieを発行した状態 headers: Set-Cookie: description: demo_session Cookie。Path=/、HttpOnly、SameSite=Lax、Domainなし、有効期限なしのsession Cookieです。デプロイ環境ではSecureを付けます。 schema: type: string content: application/json: schema: $ref: "#/components/schemas/GuestLoginResponse" examples: guest_authenticated: summary: デモ用ログイン成功 externalValue: ./examples/auth/guest-response.json GuestLoginValidationError: description: trim後の表示名が空、または32 Unicode code pointを超えています。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: display_name_required: summary: trim後の表示名が空 externalValue: ./examples/auth/error-display-name-required.json display_name_too_long: summary: trim後の表示名が32文字を超過 externalValue: ./examples/auth/error-display-name-too-long.json RunStartOrResumeSuccess: description: activeな挑戦状態 content: application/json: schema: $ref: "#/components/schemas/ActiveRunResponse" examples: new_run: summary: 新規開始したrun externalValue: ./examples/runs/start-new-response.json resumed_run: summary: 既存のactive runを再開 externalValue: ./examples/runs/active-response.json CurrentRunSuccess: description: 現在のactiveな挑戦状態 content: application/json: schema: $ref: "#/components/schemas/ActiveRunResponse" examples: current_run: summary: 再読込後に取得したactive run externalValue: ./examples/runs/active-response.json RoomSuccess: description: 部屋詳細情報 content: application/json: schema: $ref: "#/components/schemas/RoomResponse" examples: active: summary: active な run を持つ部屋詳細 externalValue: ./examples/rooms/response-active.json not_started: summary: 未挑戦または未認証時の部屋詳細 externalValue: ./examples/rooms/response-not-started.json cleared: summary: クリア済みの部屋詳細 externalValue: ./examples/rooms/response-cleared.json LeaderboardSuccess: description: 部屋別leaderboard content: application/json: schema: $ref: "#/components/schemas/LeaderboardResponse" examples: ranked: summary: 同順位を含むleaderboardと現在のユーザー externalValue: ./examples/leaderboard/response-ranked.json unauthenticated: summary: 未認証時のleaderboard externalValue: ./examples/leaderboard/response-unauthenticated.json empty: summary: clear recordがないleaderboard externalValue: ./examples/leaderboard/response-empty.json ProblemCreateSuccess: description: 問題の作成に成功しました。 content: application/json: schema: $ref: "#/components/schemas/CreateProblemResponse" examples: created: summary: 新しいproblem_id externalValue: ./examples/problems/create-response.json ProblemCreateBadRequest: description: | room_id、JSON、またはIdempotency-Keyの形式が不正です。 error.codeはINVALID_PATH_PARAMETER、INVALID_JSON、 IDEMPOTENCY_KEY_REQUIRED、INVALID_IDEMPOTENCY_KEYのいずれかです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemCreateNotFound: description: | 指定されたroomが存在しません。 error.codeはROOM_NOT_FOUNDです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemCreateConflict: description: | 公開済みroom、問題番号の重複、またはidempotencyの状態により作成できません。 error.codeはPUBLISHED_ROOM_IMMUTABLE、PROBLEM_NUMBER_CONFLICT、 IDEMPOTENCY_KEY_REUSEDのいずれかです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemCreateValidationError: description: | 問題内容、回答設定、依存関係、操作列、またはヒントが不正です。 error.codeはINVALID_PROBLEMです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemCreateInternalServerError: description: | DB更新失敗などのserver内部エラーです。 error.codeはINTERNAL_SERVER_ERRORです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemsSuccess: description: 挑戦中の部屋の問題一覧 content: application/json: schema: $ref: "#/components/schemas/ProblemsResponse" examples: listed: summary: 挑戦中の問題一覧 externalValue: ./examples/problems/list-response.json ProblemSuccess: description: 公開可能な問題データ content: application/json: schema: $ref: "#/components/schemas/ProblemResponse" examples: available_problem: summary: 挑戦可能な小なぞ externalValue: ./examples/problems/available-response.json ProblemAssetsSuccess: description: 対象problemに登録された画像と、300秒間有効なpresigned GET URL headers: Cache-Control: description: presigned URLを共有cacheへ保存させません。 schema: type: string example: no-store content: application/json: schema: $ref: "#/components/schemas/ProblemAssetsResponse" examples: listed: summary: 複数の画像を取得する場合 externalValue: ./examples/assets/response-list.json ProblemAssetsBadRequest: description: | room_idまたはproblem_idがUUIDではありません。 error.codeはINVALID_PATH_PARAMETERです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetsNotFound: description: | activeなrunがないか、指定されたproblemに取得可能な画像がありません。 error.codeはRUN_NOT_FOUNDまたはIMAGE_NOT_FOUNDです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: run_not_found: summary: activeなrunが存在しない場合 externalValue: ./examples/runs/error-run-not-found.json image_not_found: summary: problemまたは画像が存在しない場合 externalValue: ./examples/assets/error-image-not-found.json ProblemAssetsInternalServerError: description: | DBアクセスまたはpresigned URL生成に失敗しました。 error.codeはINTERNAL_SERVER_ERRORです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadSuccess: description: 画像をuploadし、対象problemへの紐付けが完了しました。 content: application/json: schema: $ref: "#/components/schemas/Asset" examples: created: summary: PNG画像のupload成功 externalValue: ./examples/assets/response-created.json ProblemAssetUploadBadRequest: description: | upload requestの形式が不正です。 error.codeはINVALID_PATH_PARAMETER、INVALID_MULTIPART、 IDEMPOTENCY_KEY_REQUIRED、INVALID_IDEMPOTENCY_KEYのいずれかです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadNotFound: description: | roomまたはproblemが存在しないか、problemが指定されたroomに属していません。 error.codeはROOM_OR_PROBLEM_NOT_FOUNDです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadConflict: description: | 公開済みroomまたはidempotencyの状態によりuploadできません。 error.codeはPUBLISHED_ROOM_IMMUTABLE、IDEMPOTENCY_KEY_REUSED、 IDEMPOTENCY_REQUEST_IN_PROGRESSのいずれかです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadTooLarge: description: | file sizeが5,242,880 bytesを超えています。 error.codeはIMAGE_TOO_LARGEです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadUnsupportedMediaType: description: | 実file内容がPNG、JPEG、WebPではありません。SVGも許可しません。 error.codeはUNSUPPORTED_IMAGE_TYPEです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadValidationError: description: | file内容、画像寸法、またはtrim後のaltが不正です。 error.codeはEMPTY_FILE、INVALID_IMAGE、IMAGE_DIMENSIONS_EXCEEDED、 INVALID_ALTのいずれかです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadInternalServerError: description: | DB更新失敗などのserver内部エラーです。 error.codeはINTERNAL_SERVER_ERRORです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadProviderError: description: | storage providerが4xx responseを返しました。 error.codeはSTORAGE_PROVIDER_ERRORです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemAssetUploadUnavailable: description: | storage providerへの接続失敗、10秒のtimeout、またはproviderの5xxです。 error.codeはSTORAGE_UNAVAILABLEです。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" ProblemHintSuccess: description: ヒント本文 content: application/json: schema: $ref: "#/components/schemas/ProblemHintResponse" examples: hint_level_1: summary: level 1のヒント externalValue: ./examples/problems/hint-level1-response.json QuerySuccess: description: 操作列の判定結果。不正解もこの200 responseを使用します。 content: application/json: schema: $ref: "#/components/schemas/QueryResponse" examples: incorrect_query: summary: 不正解の操作列 externalValue: ./examples/queries/response-incorrect.json correct_query: summary: 正解の操作列 externalValue: ./examples/queries/response-correct.json AnswerSuccess: description: 文字列回答の判定結果。不正解もこの200 responseを使用します。 content: application/json: schema: $ref: "#/components/schemas/AnswerResponse" examples: incorrect_answer: summary: 不正解の文字列回答 externalValue: ./examples/answers/response-incorrect.json correct_answer_unlocks_problem: summary: 正解して次の問題を解放 externalValue: ./examples/answers/response-correct-unlock.json correct_answer_clears_run: summary: 最後の必須問題に正解してrunをclear externalValue: ./examples/answers/response-correct-cleared.json BadRequest: description: JSON構文不正またはpath parameterのUUID形式不正。具体的なerror.codeは未確定です。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" Unauthorized: description: 未ログイン content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: unauthorized: summary: ゲームAPIを未ログインで呼び出した場合 externalValue: ./examples/auth/error-unauthorized.json NotFound: description: 対象resourceが存在しないか、現在のAUTH_MODEではendpointが有効ではありません。具体的なerror.codeは未確定です。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" RunNotFound: description: activeなrunが存在しません。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: run_not_found: summary: 現在挑戦中のrunがない場合 externalValue: ./examples/runs/error-run-not-found.json ProblemLocked: description: 問題がまだ解放されていません。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: problem_locked: summary: lockedな問題を操作した場合 externalValue: ./examples/problems/error-problem-locked.json QueryConflict: description: 操作列を送信できない問題状態です。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: problem_locked: summary: lockedな問題へ送信した場合 externalValue: ./examples/problems/error-problem-locked.json problem_already_cleared: summary: cleared済み問題へ送信した場合 externalValue: ./examples/problems/error-problem-already-cleared.json AnswerConflict: description: 文字列回答を送信できない問題状態です。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: problem_locked: summary: lockedな問題へ送信した場合 externalValue: ./examples/problems/error-problem-locked.json problem_already_cleared: summary: cleared済み問題へ送信した場合 externalValue: ./examples/problems/error-problem-already-cleared.json QueryValidationError: description: 操作列またはsourceが問題ごとの制約に違反しています。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" examples: validation_error: summary: 操作列またはsourceが不正な場合 externalValue: ./examples/queries/error-validation.json UnprocessableEntity: description: 文字数超過など入力内容が不正です。具体的なerror.codeは未確定です。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" InternalServerError: description: server内部エラー。具体的なerror.codeは未確定です。 content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" schemas: User: type: object required: - id - display_name properties: id: type: string format: uuid display_name: type: string MeResponse: oneOf: - $ref: "#/components/schemas/MeNeoshowcaseAuthenticated" - $ref: "#/components/schemas/MeNeoshowcaseUnauthenticated" - $ref: "#/components/schemas/MeDemoAuthenticated" - $ref: "#/components/schemas/MeDemoUnauthenticated" MeProgressResponse: type: object required: - cleared_room_count - total_room_count - by_genre properties: cleared_room_count: type: integer format: int32 minimum: 0 total_room_count: type: integer format: int32 minimum: 0 by_genre: type: array items: $ref: "#/components/schemas/GenreProgress" GenreProgress: type: object required: - genre - cleared_room_count - total_room_count properties: genre: type: string cleared_room_count: type: integer format: int32 minimum: 0 total_room_count: type: integer format: int32 minimum: 0 MeNeoshowcaseAuthenticated: type: object required: - authenticated - auth_mode - user - login_url - logout_url properties: authenticated: type: boolean const: true auth_mode: type: string const: neoshowcase user: $ref: "#/components/schemas/User" login_url: type: "null" logout_url: type: string MeNeoshowcaseUnauthenticated: type: object required: - authenticated - auth_mode - user - login_url - logout_url properties: authenticated: type: boolean const: false auth_mode: type: string const: neoshowcase user: type: "null" login_url: type: string logout_url: type: "null" MeDemoAuthenticated: type: object required: - authenticated - auth_mode - user - login_url - logout_url properties: authenticated: type: boolean const: true auth_mode: type: string const: demo user: $ref: "#/components/schemas/User" login_url: type: "null" logout_url: type: "null" MeDemoUnauthenticated: type: object required: - authenticated - auth_mode - user - login_url - logout_url properties: authenticated: type: boolean const: false auth_mode: type: string const: demo user: type: "null" login_url: type: "null" logout_url: type: "null" GuestLoginRequest: type: object required: - display_name properties: display_name: type: string description: 前後のUnicode空白をserverで除去し、除去後1〜32 Unicode code pointを許可します。 GuestLoginResponse: type: object required: - authenticated - user properties: authenticated: type: boolean const: true user: $ref: "#/components/schemas/User" ActiveRunResponse: type: object required: - status - started_at - elapsed_ms - cleared_problem_ids properties: status: type: string const: active started_at: type: string format: date-time elapsed_ms: type: integer format: int64 minimum: 0 cleared_problem_ids: type: array items: type: string format: uuid RoomResponse: type: object required: - id - number - name - genre - description - problem_count - run_status - ranking_summary properties: id: type: string format: uuid number: type: integer minimum: 1 name: type: string genre: type: string description: type: string problem_count: type: integer minimum: 0 run_status: $ref: "#/components/schemas/RoomRunStatus" ranking_summary: $ref: "#/components/schemas/RoomRankingSummary" RoomRunStatus: type: string enum: - not_started - active - cleared RoomRankingSummary: type: object required: - player_count - my_rank properties: player_count: type: integer minimum: 0 my_rank: oneOf: - type: integer minimum: 1 - type: "null" LeaderboardResponse: type: object required: - room_id - entries - me properties: room_id: type: string format: uuid entries: type: array items: $ref: "#/components/schemas/LeaderboardEntry" me: oneOf: - $ref: "#/components/schemas/LeaderboardMe" - type: "null" LeaderboardEntry: type: object required: - rank - user - elapsed_ms - query_count - cleared_at properties: rank: type: integer format: int32 minimum: 1 user: $ref: "#/components/schemas/User" elapsed_ms: type: integer format: int64 minimum: 0 query_count: type: integer format: int64 minimum: 0 cleared_at: type: string format: date-time LeaderboardMe: type: object required: - rank - elapsed_ms - query_count properties: rank: type: integer format: int32 minimum: 1 elapsed_ms: type: integer format: int64 minimum: 0 query_count: type: integer format: int64 minimum: 0 CreateProblemRequest: type: object required: - number - problem_type - title - body_markdown - submission_type - input_schema - hints - judge_config - depends_on_problem_id - is_required properties: number: type: integer format: int32 minimum: 1 problem_type: $ref: "#/components/schemas/ProblemType" title: type: string minLength: 1 maxLength: 255 body_markdown: type: string minLength: 1 submission_type: $ref: "#/components/schemas/SubmissionType" input_schema: $ref: "#/components/schemas/ProblemInputSchema" hints: type: array items: $ref: "#/components/schemas/CreateProblemHint" judge_config: $ref: "#/components/schemas/CreateProblemJudgeConfig" depends_on_problem_id: oneOf: - type: string format: uuid - type: "null" is_required: type: boolean CreateProblemResponse: type: object required: - problem_id properties: problem_id: type: string format: uuid CreateProblemHint: type: object required: - body_markdown properties: body_markdown: type: string minLength: 1 CreateProblemJudgeConfig: oneOf: - $ref: "#/components/schemas/CreateOperationSequenceJudgeConfig" - $ref: "#/components/schemas/CreateStringJudgeConfig" CreateOperationSequenceJudgeConfig: type: object required: - type - correct_operations - candidates properties: type: type: string const: operation_sequence correct_operations: type: array minItems: 1 items: $ref: "#/components/schemas/Operation" candidates: type: array minItems: 1 items: $ref: "#/components/schemas/CreateProblemCandidate" CreateProblemCandidate: type: object required: - candidate_id - operations properties: candidate_id: type: string minLength: 1 operations: type: array minItems: 1 items: $ref: "#/components/schemas/Operation" CreateStringJudgeConfig: type: object required: - type - accepted_answer - normalization properties: type: type: string const: string accepted_answer: type: string minLength: 1 normalization: $ref: "#/components/schemas/CreateStringNormalization" CreateStringNormalization: type: object required: - unicode - trim_outer_whitespace - collapse_internal_whitespace - case_sensitive properties: unicode: type: string const: nfkc trim_outer_whitespace: type: boolean collapse_internal_whitespace: type: boolean case_sensitive: type: boolean ProblemsResponse: type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/ProblemListItem" ProblemListItem: type: object required: - id - number - title - status properties: id: type: string format: uuid number: type: integer title: type: string status: $ref: "#/components/schemas/ProblemStatus" ProblemResponse: type: object required: - id - number - type - title - body_markdown - submission_type - assets - status - input_schema - hint_count properties: id: type: string format: uuid number: type: integer type: $ref: "#/components/schemas/ProblemType" title: type: string body_markdown: type: string submission_type: $ref: "#/components/schemas/SubmissionType" assets: type: array items: $ref: "#/components/schemas/Asset" status: $ref: "#/components/schemas/ProblemStatus" input_schema: $ref: "#/components/schemas/ProblemInputSchema" hint_count: type: integer ProblemHintResponse: type: object required: - level - body_markdown properties: level: type: integer body_markdown: type: string ProblemType: type: string enum: - small - final SubmissionType: type: string enum: - operation_sequence - string ProblemStatus: type: string enum: - locked - available - cleared RunStatus: type: string enum: - active - cleared ProblemAssetsResponse: type: object required: - items properties: items: type: array minItems: 1 items: $ref: "#/components/schemas/Asset" Asset: type: object required: - type - url - alt properties: type: type: string url: type: string alt: type: string ProblemInputSchema: type: object required: - query - answer properties: query: $ref: "#/components/schemas/QueryInputSchema" answer: $ref: "#/components/schemas/AnswerInputSchema" QueryInputSchema: type: object required: - type - allowed_controls - max_operations properties: type: type: string const: operation_sequence allowed_controls: type: array items: type: string max_operations: type: integer AnswerInputSchema: type: object required: - type - max_length properties: type: type: string const: string max_length: type: integer Operation: type: object required: - control - count properties: control: type: string count: type: integer QueryRequest: type: object required: - source - operations properties: source: type: string operations: type: array items: $ref: "#/components/schemas/Operation" QueryResponse: oneOf: - $ref: "#/components/schemas/IncorrectQueryResponse" - $ref: "#/components/schemas/CorrectQueryResponse" IncorrectQueryResponse: type: object required: - query_id - correct - normalized_operations - remaining_pattern_count - query_count - problem_status properties: query_id: type: string format: uuid correct: type: boolean const: false normalized_operations: type: array items: $ref: "#/components/schemas/Operation" remaining_pattern_count: type: integer query_count: type: integer format: int64 minimum: 0 problem_status: type: string const: available CorrectQueryResponse: type: object required: - query_id - correct - normalized_operations - remaining_pattern_count - query_count - problem_status properties: query_id: type: string format: uuid correct: type: boolean const: true normalized_operations: type: array items: $ref: "#/components/schemas/Operation" remaining_pattern_count: type: integer query_count: type: integer format: int64 minimum: 0 problem_status: type: string const: cleared AnswerRequest: type: object required: - answer properties: answer: type: string AnswerResponse: oneOf: - $ref: "#/components/schemas/IncorrectAnswerResponse" - $ref: "#/components/schemas/CorrectAnswerResponse" IncorrectAnswerResponse: type: object required: - correct - answer_attempt_count - problem_status - run_status properties: correct: type: boolean const: false answer_attempt_count: type: integer problem_status: type: string const: available run_status: type: string const: active CorrectAnswerResponse: type: object required: - correct - problem_status - unlocked_problem_ids - run_status - progress - elapsed_ms properties: correct: type: boolean const: true problem_status: type: string const: cleared unlocked_problem_ids: type: array items: type: string format: uuid run_status: $ref: "#/components/schemas/RunStatus" progress: $ref: "#/components/schemas/Progress" elapsed_ms: type: integer format: int64 minimum: 0 ProgressStatus: type: string enum: - not_started - active - cleared Progress: type: object required: - status - cleared_count - required_count properties: status: $ref: "#/components/schemas/ProgressStatus" cleared_count: type: integer minimum: 0 required_count: type: integer minimum: 0 BestRecord: type: object required: - elapsed_ms - rank - query_count properties: elapsed_ms: type: integer format: int64 minimum: 0 rank: type: integer minimum: 1 query_count: type: integer format: int64 minimum: 0 RoomItem: type: object required: - room_id - number - name - genre - description - problem_count - progress - best_record properties: room_id: type: string format: uuid number: type: integer minimum: 1 name: type: string genre: type: string description: type: string problem_count: type: integer minimum: 0 progress: $ref: "#/components/schemas/Progress" best_record: oneOf: - $ref: "#/components/schemas/BestRecord" - type: "null" RoomsResponse: type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/RoomItem" ErrorResponse: type: object required: - error properties: error: type: object required: - code - message - details properties: code: type: string message: type: string details: type: object