-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #18 from sophie-app/feat/odpt_file
ファイルAPIを追加
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import "@typespec/http"; | ||
import "@typespec/rest"; | ||
import "../common/class.tsp"; | ||
import "../common/error.tsp"; | ||
|
||
@service({ | ||
title: "ODPT File API", | ||
}) | ||
@server("https://api.odpt.org/api/v4", "API サーバー") | ||
@doc("配布されるファイルを取得するためのAPI") | ||
@useAuth(ApiKeyAuth<ApiKeyLocation.query, "acl:consumerKey">) | ||
namespace FileAPI; | ||
|
||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
|
||
@doc("ファイルリンクへのリダイレクト") | ||
model FileRedirect { | ||
@statusCode _: 302; | ||
} | ||
|
||
@doc("各社提供ファイル取得用API") | ||
@route("/files/{filePath}") | ||
interface FilesOperations { | ||
@doc("ファイルを取得する") | ||
@get | ||
getFiles( | ||
@query @doc("開発者サイトにて提供されるアクセストークン") `acl:consumerKey`: ConsumerKey, | ||
@path @doc("ファイルパス") filePath: string, | ||
): FileRedirect | Common.Error; | ||
} |