{"openapi":"3.1.0","info":{"title":"simple-sprite-stack 共有サイト API","version":"1.0.0","description":"焼いたモデルの検索・取得・投稿。投稿には content:write と media:write の権限が必要です。"},"servers":[{"url":"https://sprite-stack.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"ModelSummary":{"type":"object","required":["id","title","author","license","licenseLabel","tags","hasSource","size","thumbnailUrl","pageUrl","apiUrl","publishedAt"],"properties":{"id":{"type":"string","pattern":"^[0-9a-z]{26}$"},"title":{"type":"string"},"author":{"type":"string"},"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0"]},"licenseLabel":{"type":"string"},"tags":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":40}},"hasSource":{"type":"boolean"},"size":{"type":"array","minItems":3,"maxItems":3,"items":{"type":"integer","minimum":1}},"thumbnailUrl":{"type":"string","format":"uri"},"pageUrl":{"type":"string","format":"uri"},"apiUrl":{"type":"string","format":"uri"},"publishedAt":{"type":"string","format":"date-time"}}},"ModelDetail":{"type":"object","required":["id","title","author","license","licenseLabel","tags","hasSource","size","thumbnailUrl","pageUrl","apiUrl","publishedAt","description","format","formatVersion","files","derivedFrom","derivatives"],"properties":{"id":{"type":"string","pattern":"^[0-9a-z]{26}$"},"title":{"type":"string"},"author":{"type":"string"},"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0"]},"licenseLabel":{"type":"string"},"tags":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":40}},"hasSource":{"type":"boolean"},"size":{"type":"array","minItems":3,"maxItems":3,"items":{"type":"integer","minimum":1}},"thumbnailUrl":{"type":"string","format":"uri"},"pageUrl":{"type":"string","format":"uri"},"apiUrl":{"type":"string","format":"uri"},"publishedAt":{"type":"string","format":"date-time"},"description":{"type":"string","maxLength":2000},"format":{"type":"string","const":"sss"},"formatVersion":{"type":"integer","const":1},"files":{"type":"object","required":["original","preview","thumbnail","source"],"properties":{"original":{"type":"string","format":"uri"},"preview":{"type":"string","format":"uri"},"thumbnail":{"type":"string","format":"uri"},"source":{"type":["string","null"],"format":"uri","description":"作り直しの元がない場合は null。"}}},"derivedFrom":{"type":["object","null"],"description":"元のモデルの帰属情報。派生でなければ null。元が非公開なら pageUrl は null。","required":["id","title","author","license","licenseLabel","pageUrl"],"properties":{"id":{"type":"string","pattern":"^[0-9a-z]{26}$"},"title":{"type":"string"},"author":{"type":"string"},"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0"]},"licenseLabel":{"type":"string"},"pageUrl":{"type":["string","null"],"format":"uri"}}},"derivatives":{"type":"array","items":{"$ref":"#/components/schemas/ModelSummary"}}}}}},"paths":{"/api/v1/models":{"get":{"summary":"公開モデルを検索する","parameters":[{"name":"q","in":"query","description":"名前・説明文・タグを検索。最大 5 語。","schema":{"type":"string","maxLength":100}},{"name":"license","in":"query","schema":{"type":"string","enum":["CC0-1.0","CC-BY-4.0"]}},{"name":"hasSource","in":"query","schema":{"type":"boolean"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"モデルの一覧と次の開始位置","content":{"application/json":{"schema":{"type":"object","required":["items","nextOffset"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ModelSummary"}},"nextOffset":{"type":["integer","null"]}}}}}},"400":{"description":"入力の形が不正","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/models/{id}":{"get":{"summary":"モデルの情報・作り直しの元の有無・系譜・ファイルの URL を取る","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-z]{26}$"}}],"responses":{"200":{"description":"モデルの詳細","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDetail"}}}},"404":{"description":"公開モデルが見つからない","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/models/{id}/files/{name}":{"get":{"summary":"公開モデルのファイルを取る","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-z]{26}$"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","enum":["original.ss","preview.ss","source.parts.json","thumbnail.png"]}}],"responses":{"200":{"description":"モデル・作り直しの元・サムネイルのバイナリ","content":{"application/zip":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"object"}},"image/png":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"公開モデルが見つからない","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/_emdash/api/content/spst/models":{"post":{"summary":"焼いたモデルを投稿する","security":[{"bearerAuth":[]}],"parameters":[{"name":"X-EmDash-Request","in":"header","required":true,"schema":{"type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"焼いたモデル。最大 16777216 バイト。ファイル内の作者名と使用許諾が必要。"},"description":{"type":"string","maxLength":2000},"tags":{"type":"string","description":"JSON 配列を文字列にしたもの。最大 20 個、各 40 字。","example":"[\"car\",\"coach\"]"},"derivedFrom":{"type":"string","pattern":"^[0-9a-z]{26}$"}}}}}},"responses":{"201":{"description":"投稿したモデル","content":{"application/json":{"schema":{"type":"object","required":["id","pageUrl","apiUrl"],"properties":{"id":{"type":"string","pattern":"^[0-9a-z]{26}$"},"pageUrl":{"type":"string","format":"uri"},"apiUrl":{"type":"string","format":"uri"}}}}}},"400":{"description":"入力の形が不正","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"認証が必要","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"権限が不足、または所有者ではない","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"公開モデルが見つからない","content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"容量の上限を超えた","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"モデルまたは参照先が不正","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/_emdash/api/content/spst/models/{id}":{"patch":{"summary":"所有するモデルの説明文・タグを直す（名前・作者・使用許諾・ファイル・系譜は変更不可）","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-z]{26}$"}},{"name":"X-EmDash-Request","in":"header","required":true,"schema":{"type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"description":{"type":"string","maxLength":2000},"tags":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":40}}}}}}},"responses":{"200":{"description":"更新後のモデルの詳細","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"入力の形が不正","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"認証が必要","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"権限が不足、または所有者ではない","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"公開モデルが見つからない","content":{"application/json":{"schema":{"type":"object"}}}}}},"delete":{"summary":"所有するモデルを非公開にする","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-z]{26}$"}},{"name":"X-EmDash-Request","in":"header","required":true,"schema":{"type":"string","const":"1"}}],"responses":{"200":{"description":"非公開にしたモデル","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-z]{26}$"},"public":{"const":false}}}}}},"400":{"description":"入力の形が不正","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"認証が必要","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"権限が不足、または所有者ではない","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"公開モデルが見つからない","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}