Skip to content

Commit

Permalink
Merge pull request #38 from itsshashank/main
Browse files Browse the repository at this point in the history
πŸ› Fix fluid typing issue with query parameters
  • Loading branch information
robcxyz authored Nov 10, 2023
2 parents daca180 + ad23440 commit 62e4a0d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
"github.com/sudoblockio/icon-go-api/global"
)

const queryTag = "query"

// @title Icon Go API
// @version 2.0
// @description The icon tracker API
Expand Down Expand Up @@ -49,6 +51,12 @@ func Start() *fiber.App {
},
}))

// Enforces strict typing for query parameters
fiber.SetParserDecoder(fiber.ParserConfig{
SetAliasTag: queryTag,
IgnoreUnknownKeys: false,
})

// Swagger docs
app.Get(config.Config.RestPrefix+"/docs/*", swagger.HandlerDefault)

Expand Down

0 comments on commit 62e4a0d

Please sign in to comment.