Skip to content

Commit

Permalink
docs: session に関するエンドポイントを定義
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Aug 20, 2024
1 parent 69c6b46 commit 03676b1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/endpoints/session.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import "@typespec/http";
import "@typespec/rest";
import "../models/errors.tsp";
import "../models/user.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;

namespace SeichiPortalApiSchema;

@tag("Sessions")
@route("/session")
namespace Session {
@post
@summary("セッションを開始する")
op create(): {
@statusCode statusCode: 200;

/**
* `SEICHI_PORTAL__SESSION_ID` という名前の Cookie に30分間有効なセッション ID を設定します。
*/
@header SetCookie: string;
} | {
@statusCode statusCode: 401 | 500;
@body body: Error;
};

@delete
@summary("セッションを終了する")
op delete(): {
@statusCode statusCode: 200;

/**
* `SEICHI_PORTAL__SESSION_ID` という名前の Cookie に30分間有効なセッション ID を削除します。
*/
@header SetCookie: string;
} | {
@statusCode statusCode: 401 | 500;
@body body: Error;
};
}
1 change: 1 addition & 0 deletions src/main.tsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "./endpoints/forms.tsp";
import "./endpoints/users.tsp";
import "./endpoints/session.tsp";
import "@typespec/openapi";

using TypeSpec.Http;
Expand Down

0 comments on commit 03676b1

Please sign in to comment.