Skip to content

Commit

Permalink
Fix: swagger version
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 28, 2021
1 parent da2dcfd commit 228b287
Show file tree
Hide file tree
Showing 6 changed files with 410 additions and 225 deletions.
2 changes: 1 addition & 1 deletion build/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COPY cmd/api cmd/api
COPY internal internal

WORKDIR $GOPATH/src/github.com/baking-bad/bcdhub/cmd/api/
RUN go get github.com/swaggo/swag/cmd/swag
RUN go get github.com/swaggo/swag/cmd/swag@v1.7.0
RUN swag init --parseDependency --parseInternal --parseDepth 2
RUN go build -a -installsuffix cgo -o /go/bin/api .

Expand Down
218 changes: 137 additions & 81 deletions cmd/api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var doc = `{
},
{
"type": "string",
"description": "Comma-separated list of addresses (e.g. addr1,addr2,addr3)",
"description": "Comma-separated list of addresses (e.g. addr1,addr2,addr3), max 10 addresses",
"name": "address",
"in": "query"
}
Expand Down Expand Up @@ -177,6 +177,16 @@ var doc = `{
"name": "address",
"in": "path",
"required": true
},
{
"enum": [
"true",
"false"
],
"type": "string",
"description": "Hide zero balances from response",
"name": "hide_empty",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -240,6 +250,16 @@ var doc = `{
"name": "address",
"in": "path",
"required": true
},
{
"enum": [
"true",
"false"
],
"type": "string",
"description": "Hide zero balances from response",
"name": "hide_empty",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -377,7 +397,7 @@ var doc = `{
"in": "query"
},
{
"maximum": 10,
"maximum": 50,
"minimum": 0,
"type": "integer",
"description": "Requested count",
Expand All @@ -399,6 +419,16 @@ var doc = `{
"description": "Field using for sorting",
"name": "sort_by",
"in": "query"
},
{
"enum": [
"true",
"false"
],
"type": "string",
"description": "Hide zero balances from response",
"name": "hide_empty",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -2061,6 +2091,85 @@ var doc = `{
}
}
},
"/v1/contract/{network}/{address}/transfers": {
"get": {
"description": "Show contract` + "`" + `s tokens transfers.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"contract"
],
"summary": "Show contract` + "`" + `s tokens transfers",
"operationId": "get-contract-transfers",
"parameters": [
{
"type": "string",
"description": "Network",
"name": "network",
"in": "path",
"required": true
},
{
"maxLength": 36,
"minLength": 36,
"type": "string",
"description": "KT address",
"name": "address",
"in": "path",
"required": true
},
{
"maximum": 10,
"type": "integer",
"description": "Transfers count",
"name": "size",
"in": "query"
},
{
"type": "integer",
"description": "Offset",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Token ID",
"name": "token_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.TransferResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
}
}
}
},
"/v1/contract/{network}/{address}/views/execute": {
"post": {
"description": "Execute view of contracts metadata",
Expand Down Expand Up @@ -3336,85 +3445,6 @@ var doc = `{
}
}
}
},
"/v1/{network}/{address}/transfers": {
"get": {
"description": "Show contract` + "`" + `s tokens transfers.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"contract"
],
"summary": "Show contract` + "`" + `s tokens transfers",
"operationId": "get-contract-transfers",
"parameters": [
{
"type": "string",
"description": "Network",
"name": "network",
"in": "path",
"required": true
},
{
"maxLength": 36,
"minLength": 36,
"type": "string",
"description": "KT address",
"name": "address",
"in": "path",
"required": true
},
{
"maximum": 10,
"type": "integer",
"description": "Transfers count",
"name": "size",
"in": "query"
},
{
"type": "integer",
"description": "Offset",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Token ID",
"name": "token_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.TransferResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -3478,6 +3508,10 @@ var doc = `{
},
"x-itemTitle": {
"type": "string"
},
"x-options": {
"type": "object",
"additionalProperties": true
}
}
},
Expand Down Expand Up @@ -4106,10 +4140,18 @@ var doc = `{
"handlers.NetworkStats": {
"type": "object",
"properties": {
"contract_calls": {
"type": "integer",
"example": 100
},
"contracts_count": {
"type": "integer",
"example": 10
},
"fa_count": {
"type": "integer",
"example": 100
},
"languages": {
"type": "object",
"additionalProperties": {
Expand All @@ -4125,6 +4167,10 @@ var doc = `{
"items": {
"$ref": "#/definitions/handlers.Protocol"
}
},
"unique_contracts": {
"type": "integer",
"example": 100
}
}
},
Expand Down Expand Up @@ -4997,6 +5043,12 @@ var doc = `{
"type": "string"
}
},
"contract_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"count": {
"type": "integer"
},
Expand Down Expand Up @@ -5061,6 +5113,10 @@ var doc = `{
"counter": {
"type": "integer"
},
"entrypoint": {
"type": "string",
"x-nullable": true
},
"from": {
"type": "string"
},
Expand Down
Loading

0 comments on commit 228b287

Please sign in to comment.