Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
fix(docs): update swagger github action (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerLamTd authored Apr 25, 2024
1 parent 4c60ce1 commit 48f2b27
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 60 deletions.
1 change: 1 addition & 0 deletions .swaggo
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
replace common.Address string
replace encoding.TierFee uint64
32 changes: 12 additions & 20 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,25 @@ const docTemplate = `{
}
},
"definitions": {
"big.Int": {
"type": "object"
},
"encoding.TierFee": {
"type": "object",
"properties": {
"fee": {
"$ref": "#/definitions/big.Int"
},
"tier": {
"type": "integer"
}
}
},
"server.CreateAssignmentRequestBody": {
"type": "object",
"properties": {
"blobHash": {
"type": "array",
"items": {
"type": "integer"
}
},
"expiry": {
"type": "integer"
},
"feeToken": {
"type": "string"
},
"tierFees": {
"type": "array",
"items": {
"$ref": "#/definitions/encoding.TierFee"
}
"proposer": {
"type": "string"
},
"txListHash": {
"tierFees": {
"type": "array",
"items": {
"type": "integer"
Expand Down Expand Up @@ -148,6 +137,9 @@ const docTemplate = `{
"minOptimisticTierFee": {
"type": "integer"
},
"minSgxAndZkVMTierFee": {
"type": "integer"
},
"minSgxTierFee": {
"type": "integer"
},
Expand Down
32 changes: 12 additions & 20 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,36 +73,25 @@
}
},
"definitions": {
"big.Int": {
"type": "object"
},
"encoding.TierFee": {
"type": "object",
"properties": {
"fee": {
"$ref": "#/definitions/big.Int"
},
"tier": {
"type": "integer"
}
}
},
"server.CreateAssignmentRequestBody": {
"type": "object",
"properties": {
"blobHash": {
"type": "array",
"items": {
"type": "integer"
}
},
"expiry": {
"type": "integer"
},
"feeToken": {
"type": "string"
},
"tierFees": {
"type": "array",
"items": {
"$ref": "#/definitions/encoding.TierFee"
}
"proposer": {
"type": "string"
},
"txListHash": {
"tierFees": {
"type": "array",
"items": {
"type": "integer"
Expand Down Expand Up @@ -139,6 +128,9 @@
"minOptimisticTierFee": {
"type": "integer"
},
"minSgxAndZkVMTierFee": {
"type": "integer"
},
"minSgxTierFee": {
"type": "integer"
},
Expand Down
21 changes: 8 additions & 13 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
definitions:
big.Int:
type: object
encoding.TierFee:
properties:
fee:
$ref: '#/definitions/big.Int'
tier:
type: integer
type: object
server.CreateAssignmentRequestBody:
properties:
blobHash:
items:
type: integer
type: array
expiry:
type: integer
feeToken:
type: string
proposer:
type: string
tierFees:
items:
$ref: '#/definitions/encoding.TierFee'
type: array
txListHash:
items:
type: integer
type: array
Expand All @@ -42,6 +35,8 @@ definitions:
type: integer
minOptimisticTierFee:
type: integer
minSgxAndZkVMTierFee:
type: integer
minSgxTierFee:
type: integer
prover:
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
window.onload = function () {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "docs/swagger.json", //Location of Open API spec in the repo
url: "./docs/swagger.json", //Location of Open API spec in the repo
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
Expand Down
12 changes: 6 additions & 6 deletions prover/server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const (

// CreateAssignmentRequestBody represents a request body when handling assignment creation request.
type CreateAssignmentRequestBody struct {
Proposer common.Address
FeeToken common.Address
TierFees []encoding.TierFee
Expiry uint64
BlobHash common.Hash
Proposer common.Address `json:"proposer"`
FeeToken common.Address `json:"feeToken"`
TierFees []encoding.TierFee `json:"tierFees"`
Expiry uint64 `json:"expiry"`
BlobHash common.Hash `json:"blobHash"`
}

// Status represents the current prover server status.
Expand Down Expand Up @@ -82,7 +82,7 @@ type ProposeBlockResponse struct {
// can submit onchain.
//
// @Summary Try to accept a block proof assignment
// @Param body CreateAssignmentRequestBody true "assignment request body"
// @Param body body server.CreateAssignmentRequestBody true "assignment request body"
// @Accept json
// @Produce json
// @Success 200 {object} ProposeBlockResponse
Expand Down

0 comments on commit 48f2b27

Please sign in to comment.