-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.ts
37 lines (32 loc) · 806 Bytes
/
swagger.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { StarmanRequestStep } from "./request";
export interface SwaggerMethodParameter {
type: string
description: string
name: string
in: "query" | "body" | "path"
required: boolean
}
export interface SwaggerMethodResponse {
description: string
schema: {
type: "object",
$ref: string
}
}
export type SwaggerStatusCode = "200" | "201" | "401" | "400" | "403" | "500"
export interface SwaggerMethodSpec {
tags: string[]
summary: string
parameters: SwaggerMethodParameter[]
responses: {
[key in SwaggerStatusCode]: SwaggerMethodResponse
}
}
export interface SwaggerRequestPaths {
get: SwaggerMethodSpec
post: SwaggerMethodSpec
put: SwaggerMethodSpec
delete: SwaggerMethodSpec
}
export function AddRequestToSwaggerCollection(request: StarmanRequestStep) {
}