Skip to content

Commit

Permalink
fix: update swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Gelloz committed Nov 9, 2022
1 parent 90c99a4 commit fd836ca
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/api/controllers/script_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ func (ctl *ScriptController) PostScript(c *gin.Context) {

var script core.Script
if err := c.ShouldBindJSON(&script); err != nil {
panic(err)
ResponseError(c, ledger.NewValidationError(
"invalid payload"))
return
}

value, ok := c.GetQuery("preview")
Expand Down
73 changes: 72 additions & 1 deletion pkg/api/controllers/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,20 @@ paths:
error_message:
type: string
example: "invalid account address format"
"409":
description: Conflict
content:
application/json:
schema:
type: object
required:
- error_code
properties:
error_code:
type: string
example: "CONFLICT"
error_message:
type: string

/{ledger}/mapping:
get:
Expand Down Expand Up @@ -354,7 +368,36 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ScriptResult'

"400":
description: Bad Request
content:
application/json:
schema:
type: object
required:
- error_code
properties:
error_code:
type: string
example: "VALIDATION"
error_message:
type: string
example: "invalid payload"
"409":
description: Conflict
content:
application/json:
schema:
type: object
required:
- error_code
properties:
error_code:
type: string
example: "CONFLICT"
error_message:
type: string

/{ledger}/stats:
get:
tags:
Expand Down Expand Up @@ -749,6 +792,20 @@ paths:
error_message:
type: string
example: "transaction not found"
"409":
description: Conflict
content:
application/json:
schema:
type: object
required:
- error_code
properties:
error_code:
type: string
example: "CONFLICT"
error_message:
type: string

/{ledger}/transactions/{txid}/revert:
post:
Expand Down Expand Up @@ -808,6 +865,20 @@ paths:
error_message:
type: string
example: "transaction not found"
"409":
description: Conflict
content:
application/json:
schema:
type: object
required:
- error_code
properties:
error_code:
type: string
example: "CONFLICT"
error_message:
type: string

/{ledger}/transactions/batch:
post:
Expand Down

0 comments on commit fd836ca

Please sign in to comment.