Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kayprogrammer committed Dec 17, 2024
1 parent f0312ce commit 5cec284
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 18 deletions.
58 changes: 50 additions & 8 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3088,7 +3088,45 @@ const docTemplate = `{
"required": true,
"schema": {
"$ref": "#/definitions/schemas.CreateICPWallet"
}
}
],
"responses": {
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/wallet/icp/{username}/balance": {
"get": {
"description": "This endpoint returns user ICP wallet balance",
"tags": [
"Wallet"
],
"summary": "Get user ICP wallet balance",
"parameters": [
{
"type": "string",
"description": "Username of user",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/wallet/plans": {
"get": {
"description": "Retrieves a list of available subscription plans.",
Expand Down Expand Up @@ -3187,19 +3225,16 @@ const docTemplate = `{
"required": true,
"schema": {
"$ref": "#/definitions/schemas.CreateSubscriptionSchema"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/schemas.PaymentResponseSchema"
}
},
"400": {
"description": "Bad Request",
"schema": {
Expand Down Expand Up @@ -3258,11 +3293,11 @@ const docTemplate = `{
"type": "string",
"enum": [
"READER",
"WRITER"
"AUTHOR"
],
"x-enum-varnames": [
"ACCTYPE_READER",
"ACCTYPE_WRITER"
"ACCTYPE_AUTHOR"
]
},
"choices.AgeType": {
Expand Down Expand Up @@ -3529,6 +3564,9 @@ const docTemplate = `{
"author": {
"$ref": "#/definitions/schemas.UserDataSchema"
},
"avg_rating": {
"type": "number"
},
"blurb": {
"type": "string"
},
Expand Down Expand Up @@ -3609,6 +3647,9 @@ const docTemplate = `{
"author": {
"$ref": "#/definitions/schemas.UserDataSchema"
},
"avg_rating": {
"type": "number"
},
"blurb": {
"type": "string"
},
Expand Down Expand Up @@ -3987,7 +4028,6 @@ const docTemplate = `{
}
}
},
"schemas.CreateICPWallet": {
"type": "object",
"required": [
Expand All @@ -3998,7 +4038,9 @@ const docTemplate = `{
"type": "string",
"maxLength": 1000,
"example": "john-doe"
}
}
},
"schemas.CreateSubscriptionSchema": {
"type": "object",
"required": [
Expand Down
57 changes: 50 additions & 7 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3066,7 +3066,6 @@
}
}
},

"/wallet/icp": {
"post": {
"description": "`This endpoint creates a new ICP wallet`",
Expand All @@ -3082,7 +3081,45 @@
"required": true,
"schema": {
"$ref": "#/definitions/schemas.CreateICPWallet"

}
}
],
"responses": {
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/wallet/icp/{username}/balance": {
"get": {
"description": "This endpoint returns user ICP wallet balance",
"tags": [
"Wallet"
],
"summary": "Get user ICP wallet balance",
"parameters": [
{
"type": "string",
"description": "Username of user",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/wallet/plans": {
"get": {
"description": "Retrieves a list of available subscription plans.",
Expand Down Expand Up @@ -3181,7 +3218,6 @@
"required": true,
"schema": {
"$ref": "#/definitions/schemas.CreateSubscriptionSchema"

}
}
],
Expand Down Expand Up @@ -3250,11 +3286,11 @@
"type": "string",
"enum": [
"READER",
"WRITER"
"AUTHOR"
],
"x-enum-varnames": [
"ACCTYPE_READER",
"ACCTYPE_WRITER"
"ACCTYPE_AUTHOR"
]
},
"choices.AgeType": {
Expand Down Expand Up @@ -3521,6 +3557,9 @@
"author": {
"$ref": "#/definitions/schemas.UserDataSchema"
},
"avg_rating": {
"type": "number"
},
"blurb": {
"type": "string"
},
Expand Down Expand Up @@ -3601,6 +3640,9 @@
"author": {
"$ref": "#/definitions/schemas.UserDataSchema"
},
"avg_rating": {
"type": "number"
},
"blurb": {
"type": "string"
},
Expand Down Expand Up @@ -3979,7 +4021,6 @@
}
}
},

"schemas.CreateICPWallet": {
"type": "object",
"required": [
Expand All @@ -3990,7 +4031,9 @@
"type": "string",
"maxLength": 1000,
"example": "john-doe"

}
}
},
"schemas.CreateSubscriptionSchema": {
"type": "object",
"required": [
Expand Down
34 changes: 31 additions & 3 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ definitions:
choices.AccType:
enum:
- READER
- WRITER
- AUTHOR
type: string
x-enum-varnames:
- ACCTYPE_READER
- ACCTYPE_WRITER
- ACCTYPE_AUTHOR
choices.AgeType:
enum:
- 4
Expand Down Expand Up @@ -210,6 +210,8 @@ definitions:
$ref: '#/definitions/choices.AgeType'
author:
$ref: '#/definitions/schemas.UserDataSchema'
avg_rating:
type: number
blurb:
type: string
chapter_price:
Expand Down Expand Up @@ -264,6 +266,8 @@ definitions:
$ref: '#/definitions/choices.AgeType'
author:
$ref: '#/definitions/schemas.UserDataSchema'
avg_rating:
type: number
blurb:
type: string
chapter_price:
Expand Down Expand Up @@ -530,6 +534,7 @@ definitions:
type: string
required:
- username
type: object
schemas.CreateSubscriptionSchema:
properties:
payment_method_token:
Expand Down Expand Up @@ -3368,6 +3373,30 @@ paths:
schema:
$ref: '#/definitions/schemas.CreateICPWallet'
responses:
"400":
description: Bad Request
schema:
$ref: '#/definitions/utils.ErrorResponse'
summary: Create a new ICP wallet
tags:
- Wallet
/wallet/icp/{username}/balance:
get:
description: This endpoint returns user ICP wallet balance
parameters:
- description: Username of user
in: path
name: username
required: true
type: string
responses:
"400":
description: Bad Request
schema:
$ref: '#/definitions/utils.ErrorResponse'
summary: Get user ICP wallet balance
tags:
- Wallet
/wallet/plans:
get:
consumes:
Expand Down Expand Up @@ -3437,7 +3466,6 @@ paths:
description: Bad Request
schema:
$ref: '#/definitions/utils.ErrorResponse'
summary: Create a new ICP wallet
security:
- BearerAuth: []
summary: Subscribe
Expand Down

0 comments on commit 5cec284

Please sign in to comment.