Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenAPI spec #1759

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/update_openapi_spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

# Update OpenAPI spec
2 changes: 1 addition & 1 deletion bus/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func (b *Bus) Handler() http.Handler {

"POST /consensus/acceptblock": b.consensusAcceptBlock,
"GET /consensus/network": b.consensusNetworkHandler,
"GET /consensus/siafundfee/:payout": b.contractTaxHandlerGET,
"GET /consensus/siafundfee/:payout": b.consensusPayoutContractTaxHandlerGET,
"GET /consensus/state": b.consensusStateHandler,

"PUT /contracts": b.contractsHandlerPUT,
Expand Down
13 changes: 2 additions & 11 deletions bus/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ func (b *Bus) broadcastAction(e webhooks.Event) {
}
}

func (b *Bus) contractTaxHandlerGET(jc jape.Context) {
func (b *Bus) consensusPayoutContractTaxHandlerGET(jc jape.Context) {
var payout types.Currency
if jc.DecodeParam("payout", (*api.ParamCurrency)(&payout)) != nil {
return
Expand Down Expand Up @@ -2021,12 +2021,6 @@ func (b *Bus) webhookHandlerPost(jc jape.Context) {
}

func (b *Bus) metricsHandlerDELETE(jc jape.Context) {
key := jc.PathParam("key")
if key == "" {
jc.Error(errors.New("unknown metric ''"), http.StatusBadRequest)
return
}

var cutoff time.Time
if jc.DecodeForm("cutoff", (*api.TimeRFC3339)(&cutoff)) != nil {
return
Expand All @@ -2035,10 +2029,7 @@ func (b *Bus) metricsHandlerDELETE(jc jape.Context) {
return
}

err := b.store.PruneMetrics(jc.Request.Context(), key, cutoff)
if jc.Check("failed to prune metrics", err) != nil {
return
}
jc.Check("failed to prune metrics", b.store.PruneMetrics(jc.Request.Context(), jc.PathParam("key"), cutoff))
}

func (b *Bus) metricsHandlerPUT(jc jape.Context) {
Expand Down
Loading
Loading