From 8e6cc57bb2fd9b0df03fc1f5821602a78b79e2bb Mon Sep 17 00:00:00 2001 From: Roger <50648015+RogerLamTd@users.noreply.github.com> Date: Thu, 19 Oct 2023 06:33:02 -0700 Subject: [PATCH] chore(docs): add assignment creation request body to API doc (#432) --- docs/docs.go | 48 ++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 48 ++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 31 ++++++++++++++++++++++++++++ prover/server/api.go | 2 +- 4 files changed, 128 insertions(+), 1 deletion(-) diff --git a/docs/docs.go b/docs/docs.go index 4278f7146..cd322bd2f 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -34,6 +34,17 @@ const docTemplate = `{ ], "summary": "Try to accept a block proof assignment", "operationId": "create-assignment", + "parameters": [ + { + "description": "assignment request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/prover_server.CreateAssignmentRequestBody" + } + } + ], "responses": { "200": { "description": "OK", @@ -72,6 +83,43 @@ const docTemplate = `{ } }, "definitions": { + "big.Int": { + "type": "object" + }, + "github_com_taikoxyz_taiko-client_bindings_encoding.TierFee": { + "type": "object", + "properties": { + "fee": { + "$ref": "#/definitions/big.Int" + }, + "tier": { + "type": "integer" + } + } + }, + "prover_server.CreateAssignmentRequestBody": { + "type": "object", + "properties": { + "expiry": { + "type": "integer" + }, + "feeToken": { + "type": "string" + }, + "tierFees": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_taikoxyz_taiko-client_bindings_encoding.TierFee" + } + }, + "txListHash": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, "prover_server.ProposeBlockResponse": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 762125c07..e0db39db9 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -25,6 +25,17 @@ ], "summary": "Try to accept a block proof assignment", "operationId": "create-assignment", + "parameters": [ + { + "description": "assignment request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/prover_server.CreateAssignmentRequestBody" + } + } + ], "responses": { "200": { "description": "OK", @@ -63,6 +74,43 @@ } }, "definitions": { + "big.Int": { + "type": "object" + }, + "github_com_taikoxyz_taiko-client_bindings_encoding.TierFee": { + "type": "object", + "properties": { + "fee": { + "$ref": "#/definitions/big.Int" + }, + "tier": { + "type": "integer" + } + } + }, + "prover_server.CreateAssignmentRequestBody": { + "type": "object", + "properties": { + "expiry": { + "type": "integer" + }, + "feeToken": { + "type": "string" + }, + "tierFees": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_taikoxyz_taiko-client_bindings_encoding.TierFee" + } + }, + "txListHash": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, "prover_server.ProposeBlockResponse": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 3664a3f93..348f3bf08 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,4 +1,28 @@ definitions: + big.Int: + type: object + github_com_taikoxyz_taiko-client_bindings_encoding.TierFee: + properties: + fee: + $ref: '#/definitions/big.Int' + tier: + type: integer + type: object + prover_server.CreateAssignmentRequestBody: + properties: + expiry: + type: integer + feeToken: + type: string + tierFees: + items: + $ref: '#/definitions/github_com_taikoxyz_taiko-client_bindings_encoding.TierFee' + type: array + txListHash: + items: + type: integer + type: array + type: object prover_server.ProposeBlockResponse: properties: prover: @@ -38,6 +62,13 @@ paths: consumes: - application/json operationId: create-assignment + parameters: + - description: assignment request body + in: body + name: body + required: true + schema: + $ref: '#/definitions/prover_server.CreateAssignmentRequestBody' produces: - application/json responses: diff --git a/prover/server/api.go b/prover/server/api.go index 48243238f..aaacd72fb 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -71,7 +71,7 @@ type ProposeBlockResponse struct { // can submit onchain. // // @Summary Try to accept a block proof assignment -// @ID create-assignment +// @Param body body CreateAssignmentRequestBody true "assignment request body" // @Accept json // @Produce json // @Success 200 {object} ProposeBlockResponse