Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 3deac42

Browse files
author
Noah Lee
authored
Reorganize OpenAPI (#454)
1 parent 69bc982 commit 3deac42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2082
-2034
lines changed

Diff for: openapi/v1.yaml

-2,034
This file was deleted.

Diff for: openapi/v1/openapi.yaml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
openapi: '3.0.2'
2+
info:
3+
title: gitploy.
4+
version: '1.0'
5+
servers:
6+
- url: http://localhost/api/v1
7+
- url: https://gitploy.jp.ngrok.io/api/v1
8+
paths:
9+
/license:
10+
$ref: './paths/license/index.yaml'
11+
/repos:
12+
$ref: './paths/repos/index.yaml'
13+
/repos/{namespace}/{name}:
14+
$ref: './paths/repos/repo.yaml'
15+
/repos/{namespace}/{name}/commits:
16+
$ref: './paths/repos/commits.yaml'
17+
/repos/{namespace}/{name}/commits/{sha}:
18+
$ref: './paths/repos/commit.yaml'
19+
/repos/{namespace}/{name}/commits/{sha}/statuses:
20+
$ref: './paths/repos/commit_statuses.yaml'
21+
/repos/{namespace}/{name}/branches:
22+
$ref: './paths/repos/branches.yaml'
23+
/repos/{namespace}/{name}/branches/{branch}:
24+
$ref: './paths/repos/branch.yaml'
25+
/repos/{namespace}/{name}/tags:
26+
$ref: './paths/repos/tags.yaml'
27+
/repos/{namespace}/{name}/tags/{tag}:
28+
$ref: './paths/repos/tag.yaml'
29+
/repos/{namespace}/{name}/deployments:
30+
$ref: './paths/repos/deployments.yaml'
31+
/repos/{namespace}/{name}/deployment:
32+
$ref: './paths/repos/deployment.yaml'
33+
/repos/{namespace}/{name}/deployments/{number}/changes:
34+
$ref: './paths/repos/deployment_changes.yaml'
35+
/repos/{namespace}/{name}/deployments/{number}/rollback:
36+
$ref: './paths/repos/deployment_rollback.yaml'
37+
/repos/{namespace}/{name}/deployments/{number}/reviews:
38+
$ref: './paths/repos/deployment_reviews.yaml'
39+
/repos/{namespace}/{name}/deployments/{number}/review:
40+
$ref: './paths/repos/deployment_review.yaml'
41+
/repos/{namespace}/{name}/deployments/{number}/statuses:
42+
$ref: './paths/repos/deployment_statuses.yaml'
43+
/repos/{namespace}/{name}/deployments/{number}/remote-statuses:
44+
$ref: './paths/repos/deployment_statuses.yaml'
45+
/repos/{namespace}/{name}/locks:
46+
$ref: './paths/repos/locks.yaml'
47+
/repos/{namespace}/{name}/locks/{lockId}:
48+
$ref: './paths/repos/lock.yaml'
49+
/repos/{namespace}/{name}/perms:
50+
$ref: './paths/repos/perms.yaml'
51+
/repos/{namespace}/{name}/config:
52+
$ref: './paths/repos/config.yaml'
53+
/users:
54+
$ref: './paths/users/index.yaml'
55+
/users/{id}:
56+
$ref: './paths/users/user.yaml'
57+
/user:
58+
$ref: './paths/users/me.yaml'
59+
/user/rate-limit:
60+
$ref: './paths/users/ratelimit.yaml'
61+
/search/deployments:
62+
$ref: './paths/search/deployments.yaml'
63+
/search/reviews:
64+
$ref: './paths/search/deployments.yaml'
65+
/stream/events:
66+
$ref: './paths/stream/events.yaml'
67+
/sync:
68+
$ref: './paths/sync/index.yaml'
69+
70+
components:
71+
securitySchemes:
72+
BearerAuth:
73+
type: http
74+
scheme: bearer
75+
description: Hash key of user
76+
OAuth2:
77+
type: oauth2
78+
flows:
79+
authorizationCode:
80+
authorizationUrl: https://github.com/oauth/authorize
81+
tokenUrl: https://github.com/oauth/token
82+
scopes:
83+
read: Grants read access
84+
write: Grants write access
85+
admin: Grants access to admin operations

Diff for: openapi/v1/paths/license/index.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
get:
2+
tags:
3+
- License
4+
summary: Return license
5+
responses:
6+
'200':
7+
description: Licnese
8+
content:
9+
application/json:
10+
schema:
11+
$ref: '../../schemas/License.yaml'
12+
'500':
13+
$ref: '../../responses.yaml#/500InternalError'

Diff for: openapi/v1/paths/repos/branch.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
get:
2+
tags:
3+
- Repo
4+
summary: Get the branch of repository.
5+
parameters:
6+
- in: path
7+
name: namespace
8+
required: true
9+
schema:
10+
type: string
11+
- in: path
12+
name: name
13+
required: true
14+
schema:
15+
type: string
16+
- in: path
17+
name: branch
18+
required: true
19+
schema:
20+
type: string
21+
description: The branch name
22+
responses:
23+
'200':
24+
description: Branch
25+
content:
26+
application/json:
27+
schema:
28+
$ref: '../../schemas/Branch.yaml'
29+
'401':
30+
$ref: '../../responses.yaml#/401Unauthorized'
31+
'402':
32+
$ref: '../../responses.yaml#/402PaymentRequired'
33+
'403':
34+
$ref: '../../responses.yaml#/403Forbidden'
35+
'404':
36+
$ref: '../../responses.yaml#/404NotFound'
37+
'500':
38+
$ref: '../../responses.yaml#/500InternalError'

Diff for: openapi/v1/paths/repos/branches.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
get:
2+
tags:
3+
- Repo
4+
summary: List branches of the repository.
5+
parameters:
6+
- in: path
7+
name: namespace
8+
required: true
9+
schema:
10+
type: string
11+
- in: path
12+
name: name
13+
required: true
14+
schema:
15+
type: string
16+
- in: query
17+
name: page
18+
schema:
19+
type: integer
20+
default: 1
21+
description: The page number
22+
- in: query
23+
name: per_page
24+
schema:
25+
type: integer
26+
default: 30
27+
description: The item count per page
28+
responses:
29+
'200':
30+
description: Branches
31+
content:
32+
application/json:
33+
schema:
34+
type: array
35+
items:
36+
$ref: '../../schemas/Branch.yaml'
37+
'401':
38+
$ref: '../../responses.yaml#/401Unauthorized'
39+
'402':
40+
$ref: '../../responses.yaml#/402PaymentRequired'
41+
'403':
42+
$ref: '../../responses.yaml#/403Forbidden'
43+
'500':
44+
$ref: '../../responses.yaml#/500InternalError'

Diff for: openapi/v1/paths/repos/commit.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
get:
2+
tags:
3+
- Repo
4+
summary: Get the commit of repository.
5+
parameters:
6+
- in: path
7+
name: namespace
8+
required: true
9+
schema:
10+
type: string
11+
- in: path
12+
name: name
13+
required: true
14+
schema:
15+
type: string
16+
- in: path
17+
name: sha
18+
required: true
19+
schema:
20+
type: string
21+
description: The commit sha
22+
responses:
23+
'200':
24+
description: Commit
25+
content:
26+
application/json:
27+
schema:
28+
$ref: '../../schemas/Commit.yaml'
29+
'401':
30+
$ref: '../../responses.yaml#/401Unauthorized'
31+
'402':
32+
$ref: '../../responses.yaml#/402PaymentRequired'
33+
'403':
34+
$ref: '../../responses.yaml#/403Forbidden'
35+
'404':
36+
$ref: '../../responses.yaml#/404NotFound'
37+
'500':
38+
$ref: '../../responses.yaml#/500InternalError'

Diff for: openapi/v1/paths/repos/commit_statuses.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
get:
2+
tags:
3+
- Repo
4+
summary: List statuses of the commit.
5+
parameters:
6+
- in: path
7+
name: namespace
8+
required: true
9+
schema:
10+
type: string
11+
- in: path
12+
name: name
13+
required: true
14+
schema:
15+
type: string
16+
- in: path
17+
name: sha
18+
required: true
19+
schema:
20+
type: string
21+
description: The commit sha
22+
responses:
23+
'200':
24+
description: Statuses for ref
25+
content:
26+
application/json:
27+
schema:
28+
type: object
29+
properties:
30+
state:
31+
type: string
32+
statuses:
33+
type: array
34+
items:
35+
$ref: '../../schemas/Status.yaml'
36+
'401':
37+
$ref: '../../responses.yaml#/401Unauthorized'
38+
'402':
39+
$ref: '../../responses.yaml#/402PaymentRequired'
40+
'403':
41+
$ref: '../../responses.yaml#/403Forbidden'
42+
'404':
43+
$ref: '../../responses.yaml#/404NotFound'
44+
'500':
45+
$ref: '../../responses.yaml#/500InternalError'

Diff for: openapi/v1/paths/repos/commits.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
get:
2+
tags:
3+
- Repo
4+
summary: List commits of repository.
5+
parameters:
6+
- in: path
7+
name: namespace
8+
required: true
9+
schema:
10+
type: string
11+
- in: path
12+
name: name
13+
required: true
14+
schema:
15+
type: string
16+
- in: query
17+
name: branch
18+
schema:
19+
type: string
20+
default:
21+
description: >
22+
The branch to start listing commits from.
23+
Default - the repository’s default branch.
24+
- in: query
25+
name: page
26+
schema:
27+
type: integer
28+
default: 1
29+
description: The page number
30+
- in: query
31+
name: per_page
32+
schema:
33+
type: integer
34+
default: 30
35+
description: The page number
36+
responses:
37+
'200':
38+
description: Commits
39+
content:
40+
application/json:
41+
schema:
42+
type: array
43+
items:
44+
$ref: '../../schemas/Commit.yaml'
45+
'401':
46+
$ref: '../../responses.yaml#/401Unauthorized'
47+
'402':
48+
$ref: '../../responses.yaml#/402PaymentRequired'
49+
'403':
50+
$ref: '../../responses.yaml#/403Forbidden'
51+
'500':
52+
$ref: '../../responses.yaml#/500InternalError'

Diff for: openapi/v1/paths/repos/config.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
get:
2+
tags:
3+
- Repo
4+
summary: Get the config file
5+
parameters:
6+
- in: path
7+
name: namespace
8+
required: true
9+
schema:
10+
type: string
11+
- in: path
12+
name: name
13+
required: true
14+
schema:
15+
type: string
16+
responses:
17+
'200':
18+
description: Config
19+
content:
20+
application/json:
21+
schema:
22+
$ref: '../../schemas/Config.yaml'
23+
'401':
24+
$ref: '../../responses.yaml#/401Unauthorized'
25+
'402':
26+
$ref: '../../responses.yaml#/402PaymentRequired'
27+
'403':
28+
$ref: '../../responses.yaml#/403Forbidden'
29+
'404':
30+
$ref: '../../responses.yaml#/404NotFound'
31+
'422':
32+
$ref: '../../responses.yaml#/422UnprocessableEntity'
33+
'500':
34+
$ref: '../../responses.yaml#/500InternalError'

0 commit comments

Comments
 (0)