Skip to content

Commit

Permalink
docs: cleanup OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Dec 18, 2024
1 parent 9d3a308 commit 2e39def
Show file tree
Hide file tree
Showing 4 changed files with 371 additions and 557 deletions.
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

0 comments on commit 2e39def

Please sign in to comment.