Skip to content

Commit

Permalink
Fix /swagger.json url
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Feb 1, 2022
1 parent eeee3e1 commit 9ead085
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ require (
)

require (
github.com/davecgh/go-spew v1.1.1
github.com/go-logr/stdr v1.2.2 // indirect
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)
2 changes: 1 addition & 1 deletion pkg/api/controllers/config_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package controllers

import (
"bytes"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
"net/http"

_ "embed"
Expand Down
38 changes: 19 additions & 19 deletions pkg/api/controllers/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ paths:
description: Show server informations
operationId: getInfo
responses:
200:
"200":
description: OK
content:
application/json:
Expand All @@ -38,7 +38,7 @@ paths:
schema:
type: string
responses:
200:
"200":
description: OK
content:
application/json:
Expand All @@ -64,7 +64,7 @@ paths:
schema:
type: string
responses:
200:
"200":
description: OK
content:
application/json:
Expand Down Expand Up @@ -97,9 +97,9 @@ paths:
$ref: '#/components/schemas/Metadata'
required: true
responses:
204:
"204":
description: Empty response
400:
"400":
description: ""
content: {}
/{ledger}/mapping:
Expand All @@ -117,7 +117,7 @@ paths:
schema:
type: string
responses:
200:
"200":
description: OK
content:
application/json:
Expand All @@ -144,7 +144,7 @@ paths:
$ref: '#/components/schemas/Mapping'
required: true
responses:
200:
"200":
description: OK
content:
application/json:
Expand Down Expand Up @@ -173,7 +173,7 @@ paths:
$ref: '#/components/schemas/Script'
required: true
responses:
200:
"200":
description: OK
content:
application/json:
Expand All @@ -197,7 +197,7 @@ paths:
schema:
type: string
responses:
200:
"200":
description: OK
content:
application/json:
Expand Down Expand Up @@ -235,7 +235,7 @@ paths:
schema:
type: string
responses:
200:
"200":
description: OK
content:
application/json:
Expand Down Expand Up @@ -264,19 +264,19 @@ paths:
$ref: '#/components/schemas/TransactionData'
required: true
responses:
200:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTransactionResponse'
400:
"400":
description: Commit error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
409:
"409":
description: Confict
content:
application/json:
Expand Down Expand Up @@ -304,13 +304,13 @@ paths:
schema:
type: integer
responses:
200:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionResponse'
404:
"404":
description: Not Found
content:
application/json:
Expand Down Expand Up @@ -343,7 +343,7 @@ paths:
schema:
$ref: '#/components/schemas/Metadata'
responses:
204:
"204":
description: Empty response
content: {}
/{ledger}/transactions/{txid}/revert:
Expand All @@ -367,7 +367,7 @@ paths:
schema:
type: integer
responses:
204:
"204":
description: Empty response
content: {}
/{ledger}/transactions/batch:
Expand All @@ -394,13 +394,13 @@ paths:
$ref: '#/components/schemas/Transactions'
required: true
responses:
200:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionListResponse'
400:
"400":
description: ""
content:
application/json:
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (r *Routes) Engine(cc cors.Config) *gin.Engine {
engine.Use(globalMiddlewares...)

engine.GET("/swagger.yaml", r.configController.GetDocsAsYaml)
//engine.GET("/swagger.json", r.configController.GetDocsAsJSON)
engine.GET("/swagger.json", r.configController.GetDocsAsJSON)

// API Routes
engine.GET("/_info", r.configController.GetInfo)
Expand Down

0 comments on commit 9ead085

Please sign in to comment.