Skip to content

Commit

Permalink
swagger update action
Browse files Browse the repository at this point in the history
  • Loading branch information
fanhousanbu committed Mar 5, 2024
1 parent 6af2dc5 commit 0d7f8f0
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ jobs:
- name: Test
run: go test -v ./...
- name: Swagger
run: |
go install github.com/swaggo/swag/cmd/swag@latest
swag init -g ./cmd/server/main.go
git config user.name devops
git config suer.email [email protected]
git add ./docs
git commit -m "swagger updated"
git push
run: chmod +x ./.github/scripts/auto-swagger.sh && ./.github/scripts/auto-swagger.sh



name: Building And Testing
135 changes: 135 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"swagger": "2.0",
"info": {
"contact": {
"name": "AAStar Support",
"url": "https://aastar.xyz"
}
},
"paths": {
"/api/auth": {
"post": {
"description": "Get AccessToken By ApiKey",
"consumes": [
"application/json"
],
"tags": [
"Auth"
],
"parameters": [
{
"description": "AccessToken Model",
"name": "credential",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.ClientCredential"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/healthz": {
"get": {
"description": "Get Healthz",
"tags": [
"Healthz"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/v1/get-support-entrypoint": {
"get": {
"security": [
{
"JWT": []
}
],
"description": "get the support entrypoint",
"consumes": [
"application/json"
],
"tags": [
"Sponsor"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/v1/get-support-strategy": {
"get": {
"security": [
{
"JWT": []
}
],
"description": "get the support strategy",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Sponsor"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/v1/try-pay-user-operation": {
"post": {
"security": [
{
"JWT": []
}
],
"description": "sponsor the userOp",
"consumes": [
"application/json"
],
"tags": [
"Sponsor"
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"definitions": {
"models.ClientCredential": {
"type": "object",
"properties": {
"apiKey": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"JWT": {
"description": "Type 'Bearer \\\u003cTOKEN\\\u003e' to correctly set the AccessToken",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}
81 changes: 81 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
definitions:
models.ClientCredential:
properties:
apiKey:
type: string
type: object
info:
contact:
name: AAStar Support
url: https://aastar.xyz
paths:
/api/auth:
post:
consumes:
- application/json
description: Get AccessToken By ApiKey
parameters:
- description: AccessToken Model
in: body
name: credential
required: true
schema:
$ref: '#/definitions/models.ClientCredential'
responses:
"200":
description: OK
tags:
- Auth
/api/healthz:
get:
description: Get Healthz
responses:
"200":
description: OK
tags:
- Healthz
/api/v1/get-support-entrypoint:
get:
consumes:
- application/json
description: get the support entrypoint
responses:
"200":
description: OK
security:
- JWT: []
tags:
- Sponsor
/api/v1/get-support-strategy:
get:
consumes:
- application/json
description: get the support strategy
produces:
- application/json
responses:
"200":
description: OK
security:
- JWT: []
tags:
- Sponsor
/api/v1/try-pay-user-operation:
post:
consumes:
- application/json
description: sponsor the userOp
responses:
"200":
description: OK
security:
- JWT: []
tags:
- Sponsor
securityDefinitions:
JWT:
description: Type 'Bearer \<TOKEN\>' to correctly set the AccessToken
in: header
name: Authorization
type: apiKey
swagger: "2.0"

0 comments on commit 0d7f8f0

Please sign in to comment.