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

Reorganize the OpenAPI file #454

Merged
merged 1 commit into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,034 changes: 0 additions & 2,034 deletions openapi/v1.yaml

This file was deleted.

85 changes: 85 additions & 0 deletions openapi/v1/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
openapi: '3.0.2'
info:
title: gitploy.
version: '1.0'
servers:
- url: http://localhost/api/v1
- url: https://gitploy.jp.ngrok.io/api/v1
paths:
/license:
$ref: './paths/license/index.yaml'
/repos:
$ref: './paths/repos/index.yaml'
/repos/{namespace}/{name}:
$ref: './paths/repos/repo.yaml'
/repos/{namespace}/{name}/commits:
$ref: './paths/repos/commits.yaml'
/repos/{namespace}/{name}/commits/{sha}:
$ref: './paths/repos/commit.yaml'
/repos/{namespace}/{name}/commits/{sha}/statuses:
$ref: './paths/repos/commit_statuses.yaml'
/repos/{namespace}/{name}/branches:
$ref: './paths/repos/branches.yaml'
/repos/{namespace}/{name}/branches/{branch}:
$ref: './paths/repos/branch.yaml'
/repos/{namespace}/{name}/tags:
$ref: './paths/repos/tags.yaml'
/repos/{namespace}/{name}/tags/{tag}:
$ref: './paths/repos/tag.yaml'
/repos/{namespace}/{name}/deployments:
$ref: './paths/repos/deployments.yaml'
/repos/{namespace}/{name}/deployment:
$ref: './paths/repos/deployment.yaml'
/repos/{namespace}/{name}/deployments/{number}/changes:
$ref: './paths/repos/deployment_changes.yaml'
/repos/{namespace}/{name}/deployments/{number}/rollback:
$ref: './paths/repos/deployment_rollback.yaml'
/repos/{namespace}/{name}/deployments/{number}/reviews:
$ref: './paths/repos/deployment_reviews.yaml'
/repos/{namespace}/{name}/deployments/{number}/review:
$ref: './paths/repos/deployment_review.yaml'
/repos/{namespace}/{name}/deployments/{number}/statuses:
$ref: './paths/repos/deployment_statuses.yaml'
/repos/{namespace}/{name}/deployments/{number}/remote-statuses:
$ref: './paths/repos/deployment_statuses.yaml'
/repos/{namespace}/{name}/locks:
$ref: './paths/repos/locks.yaml'
/repos/{namespace}/{name}/locks/{lockId}:
$ref: './paths/repos/lock.yaml'
/repos/{namespace}/{name}/perms:
$ref: './paths/repos/perms.yaml'
/repos/{namespace}/{name}/config:
$ref: './paths/repos/config.yaml'
/users:
$ref: './paths/users/index.yaml'
/users/{id}:
$ref: './paths/users/user.yaml'
/user:
$ref: './paths/users/me.yaml'
/user/rate-limit:
$ref: './paths/users/ratelimit.yaml'
/search/deployments:
$ref: './paths/search/deployments.yaml'
/search/reviews:
$ref: './paths/search/deployments.yaml'
/stream/events:
$ref: './paths/stream/events.yaml'
/sync:
$ref: './paths/sync/index.yaml'

components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: Hash key of user
OAuth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://github.com/oauth/authorize
tokenUrl: https://github.com/oauth/token
scopes:
read: Grants read access
write: Grants write access
admin: Grants access to admin operations
13 changes: 13 additions & 0 deletions openapi/v1/paths/license/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
get:
tags:
- License
summary: Return license
responses:
'200':
description: Licnese
content:
application/json:
schema:
$ref: '../../schemas/License.yaml'
'500':
$ref: '../../responses.yaml#/500InternalError'
38 changes: 38 additions & 0 deletions openapi/v1/paths/repos/branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
get:
tags:
- Repo
summary: Get the branch of repository.
parameters:
- in: path
name: namespace
required: true
schema:
type: string
- in: path
name: name
required: true
schema:
type: string
- in: path
name: branch
required: true
schema:
type: string
description: The branch name
responses:
'200':
description: Branch
content:
application/json:
schema:
$ref: '../../schemas/Branch.yaml'
'401':
$ref: '../../responses.yaml#/401Unauthorized'
'402':
$ref: '../../responses.yaml#/402PaymentRequired'
'403':
$ref: '../../responses.yaml#/403Forbidden'
'404':
$ref: '../../responses.yaml#/404NotFound'
'500':
$ref: '../../responses.yaml#/500InternalError'
44 changes: 44 additions & 0 deletions openapi/v1/paths/repos/branches.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
get:
tags:
- Repo
summary: List branches of the repository.
parameters:
- in: path
name: namespace
required: true
schema:
type: string
- in: path
name: name
required: true
schema:
type: string
- in: query
name: page
schema:
type: integer
default: 1
description: The page number
- in: query
name: per_page
schema:
type: integer
default: 30
description: The item count per page
responses:
'200':
description: Branches
content:
application/json:
schema:
type: array
items:
$ref: '../../schemas/Branch.yaml'
'401':
$ref: '../../responses.yaml#/401Unauthorized'
'402':
$ref: '../../responses.yaml#/402PaymentRequired'
'403':
$ref: '../../responses.yaml#/403Forbidden'
'500':
$ref: '../../responses.yaml#/500InternalError'
38 changes: 38 additions & 0 deletions openapi/v1/paths/repos/commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
get:
tags:
- Repo
summary: Get the commit of repository.
parameters:
- in: path
name: namespace
required: true
schema:
type: string
- in: path
name: name
required: true
schema:
type: string
- in: path
name: sha
required: true
schema:
type: string
description: The commit sha
responses:
'200':
description: Commit
content:
application/json:
schema:
$ref: '../../schemas/Commit.yaml'
'401':
$ref: '../../responses.yaml#/401Unauthorized'
'402':
$ref: '../../responses.yaml#/402PaymentRequired'
'403':
$ref: '../../responses.yaml#/403Forbidden'
'404':
$ref: '../../responses.yaml#/404NotFound'
'500':
$ref: '../../responses.yaml#/500InternalError'
45 changes: 45 additions & 0 deletions openapi/v1/paths/repos/commit_statuses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
get:
tags:
- Repo
summary: List statuses of the commit.
parameters:
- in: path
name: namespace
required: true
schema:
type: string
- in: path
name: name
required: true
schema:
type: string
- in: path
name: sha
required: true
schema:
type: string
description: The commit sha
responses:
'200':
description: Statuses for ref
content:
application/json:
schema:
type: object
properties:
state:
type: string
statuses:
type: array
items:
$ref: '../../schemas/Status.yaml'
'401':
$ref: '../../responses.yaml#/401Unauthorized'
'402':
$ref: '../../responses.yaml#/402PaymentRequired'
'403':
$ref: '../../responses.yaml#/403Forbidden'
'404':
$ref: '../../responses.yaml#/404NotFound'
'500':
$ref: '../../responses.yaml#/500InternalError'
52 changes: 52 additions & 0 deletions openapi/v1/paths/repos/commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
get:
tags:
- Repo
summary: List commits of repository.
parameters:
- in: path
name: namespace
required: true
schema:
type: string
- in: path
name: name
required: true
schema:
type: string
- in: query
name: branch
schema:
type: string
default:
description: >
The branch to start listing commits from.
Default - the repository’s default branch.
- in: query
name: page
schema:
type: integer
default: 1
description: The page number
- in: query
name: per_page
schema:
type: integer
default: 30
description: The page number
responses:
'200':
description: Commits
content:
application/json:
schema:
type: array
items:
$ref: '../../schemas/Commit.yaml'
'401':
$ref: '../../responses.yaml#/401Unauthorized'
'402':
$ref: '../../responses.yaml#/402PaymentRequired'
'403':
$ref: '../../responses.yaml#/403Forbidden'
'500':
$ref: '../../responses.yaml#/500InternalError'
34 changes: 34 additions & 0 deletions openapi/v1/paths/repos/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
get:
tags:
- Repo
summary: Get the config file
parameters:
- in: path
name: namespace
required: true
schema:
type: string
- in: path
name: name
required: true
schema:
type: string
responses:
'200':
description: Config
content:
application/json:
schema:
$ref: '../../schemas/Config.yaml'
'401':
$ref: '../../responses.yaml#/401Unauthorized'
'402':
$ref: '../../responses.yaml#/402PaymentRequired'
'403':
$ref: '../../responses.yaml#/403Forbidden'
'404':
$ref: '../../responses.yaml#/404NotFound'
'422':
$ref: '../../responses.yaml#/422UnprocessableEntity'
'500':
$ref: '../../responses.yaml#/500InternalError'
Loading