Skip to content

Commit

Permalink
Merge pull request #18 from sophie-app/feat/odpt_file
Browse files Browse the repository at this point in the history
ファイルAPIを追加
  • Loading branch information
mst-mkt authored Oct 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents c510ddf + a490b1a commit f3b12ea
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/file/index.tsp
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;
}

0 comments on commit f3b12ea

Please sign in to comment.