From 0bf94c732f9312795cd9921c840762a54297f4ec Mon Sep 17 00:00:00 2001 From: UlyanaAndrukhiv Date: Mon, 13 Jan 2025 14:27:19 +0200 Subject: [PATCH 1/5] Added omitempty tag to Expandable field for Block --- openapi/access.yaml | 1 - openapi/go-client-generated/api/swagger.yaml | 1 - openapi/go-client-generated/docs/Block.md | 2 +- openapi/go-client-generated/model_block.go | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openapi/access.yaml b/openapi/access.yaml index 441fbaae4..8c6b3b807 100644 --- a/openapi/access.yaml +++ b/openapi/access.yaml @@ -937,7 +937,6 @@ components: type: object required: - header - - _expandable properties: header: $ref: '#/components/schemas/BlockHeader' diff --git a/openapi/go-client-generated/api/swagger.yaml b/openapi/go-client-generated/api/swagger.yaml index 3f4abf614..c85e01937 100644 --- a/openapi/go-client-generated/api/swagger.yaml +++ b/openapi/go-client-generated/api/swagger.yaml @@ -1577,7 +1577,6 @@ components: - Expired Block: required: - - _expandable - header type: object properties: diff --git a/openapi/go-client-generated/docs/Block.md b/openapi/go-client-generated/docs/Block.md index d683a5ef6..c7308560c 100644 --- a/openapi/go-client-generated/docs/Block.md +++ b/openapi/go-client-generated/docs/Block.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **Header** | [***BlockHeader**](BlockHeader.md) | | [default to null] **Payload** | [***BlockPayload**](BlockPayload.md) | | [optional] [default to null] **ExecutionResult** | [***ExecutionResult**](ExecutionResult.md) | | [optional] [default to null] -**Expandable** | [***BlockExpandable**](Block__expandable.md) | | [default to null] +**Expandable** | [***BlockExpandable**](Block__expandable.md) | | [optional] [default to null] **Links** | [***Links**](Links.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/openapi/go-client-generated/model_block.go b/openapi/go-client-generated/model_block.go index 860f60013..3a916dad3 100644 --- a/openapi/go-client-generated/model_block.go +++ b/openapi/go-client-generated/model_block.go @@ -12,6 +12,6 @@ type Block struct { Header *BlockHeader `json:"header"` Payload *BlockPayload `json:"payload,omitempty"` ExecutionResult *ExecutionResult `json:"execution_result,omitempty"` - Expandable *BlockExpandable `json:"_expandable"` + Expandable *BlockExpandable `json:"_expandable,omitempty"` Links *Links `json:"_links,omitempty"` } From 4c3fcf5ad9ddb0743f4fcce891efbf211e42c11b Mon Sep 17 00:00:00 2001 From: UlyanaAndrukhiv Date: Tue, 14 Jan 2025 15:55:20 +0200 Subject: [PATCH 2/5] Added missed block_status field to Block --- openapi/access.yaml | 3 +++ openapi/go-client-generated/api/swagger.yaml | 4 ++++ openapi/go-client-generated/docs/Block.md | 1 + openapi/go-client-generated/model_block.go | 1 + 4 files changed, 9 insertions(+) diff --git a/openapi/access.yaml b/openapi/access.yaml index 8c6b3b807..a6ec105d7 100644 --- a/openapi/access.yaml +++ b/openapi/access.yaml @@ -937,6 +937,7 @@ components: type: object required: - header + - block_status properties: header: $ref: '#/components/schemas/BlockHeader' @@ -954,6 +955,8 @@ components: format: uri _links: $ref: '#/components/schemas/Links' + block_status: + type: string BlockHeader: type: object required: diff --git a/openapi/go-client-generated/api/swagger.yaml b/openapi/go-client-generated/api/swagger.yaml index c85e01937..9928a6cdf 100644 --- a/openapi/go-client-generated/api/swagger.yaml +++ b/openapi/go-client-generated/api/swagger.yaml @@ -1577,6 +1577,7 @@ components: - Expired Block: required: + - block_status - header type: object properties: @@ -1590,7 +1591,10 @@ components: $ref: '#/components/schemas/Block__expandable' _links: $ref: '#/components/schemas/Links' + block_status: + type: string example: + block_status: block_status payload: collection_guarantees: - collection_id: null diff --git a/openapi/go-client-generated/docs/Block.md b/openapi/go-client-generated/docs/Block.md index c7308560c..9ccadf117 100644 --- a/openapi/go-client-generated/docs/Block.md +++ b/openapi/go-client-generated/docs/Block.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **ExecutionResult** | [***ExecutionResult**](ExecutionResult.md) | | [optional] [default to null] **Expandable** | [***BlockExpandable**](Block__expandable.md) | | [optional] [default to null] **Links** | [***Links**](Links.md) | | [optional] [default to null] +**BlockStatus** | **string** | | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/openapi/go-client-generated/model_block.go b/openapi/go-client-generated/model_block.go index 3a916dad3..48d8addc7 100644 --- a/openapi/go-client-generated/model_block.go +++ b/openapi/go-client-generated/model_block.go @@ -14,4 +14,5 @@ type Block struct { ExecutionResult *ExecutionResult `json:"execution_result,omitempty"` Expandable *BlockExpandable `json:"_expandable,omitempty"` Links *Links `json:"_links,omitempty"` + BlockStatus string `json:"block_status"` } From 2ba8af54b2a496f93702e8fbf80f72944c8a7557 Mon Sep 17 00:00:00 2001 From: Andrii Slisarchuk Date: Thu, 23 Jan 2025 14:16:00 +0200 Subject: [PATCH 3/5] added block status enum --- openapi/access.yaml | 9 ++++++++- openapi/go-client-generated/README.md | 1 + openapi/go-client-generated/api/swagger.yaml | 11 +++++++++-- openapi/go-client-generated/docs/Block.md | 2 +- .../go-client-generated/docs/BlockStatus.md | 8 ++++++++ openapi/go-client-generated/model_block.go | 2 +- .../go-client-generated/model_block_status.go | 18 ++++++++++++++++++ 7 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 openapi/go-client-generated/docs/BlockStatus.md create mode 100644 openapi/go-client-generated/model_block_status.go diff --git a/openapi/access.yaml b/openapi/access.yaml index a6ec105d7..e60edecab 100644 --- a/openapi/access.yaml +++ b/openapi/access.yaml @@ -933,6 +933,13 @@ components: - Executed - Sealed - Expired + BlockStatus: + type: string + description: This value indicates the status of a block. + enum: + - BLOCK_UNKNOWN + - BLOCK_FINALIZED + - BLOCK_SEALED Block: type: object required: @@ -956,7 +963,7 @@ components: _links: $ref: '#/components/schemas/Links' block_status: - type: string + $ref: '#/components/schemas/BlockStatus' BlockHeader: type: object required: diff --git a/openapi/go-client-generated/README.md b/openapi/go-client-generated/README.md index e2bbbf779..50b96a91d 100644 --- a/openapi/go-client-generated/README.md +++ b/openapi/go-client-generated/README.md @@ -51,6 +51,7 @@ Class | Method | HTTP request | Description - [BlockHeight](docs/BlockHeight.md) - [BlockPayload](docs/BlockPayload.md) - [BlockSeal](docs/BlockSeal.md) + - [BlockStatus](docs/BlockStatus.md) - [Chunk](docs/Chunk.md) - [Collection](docs/Collection.md) - [CollectionExpandable](docs/CollectionExpandable.md) diff --git a/openapi/go-client-generated/api/swagger.yaml b/openapi/go-client-generated/api/swagger.yaml index 9928a6cdf..8cad874e7 100644 --- a/openapi/go-client-generated/api/swagger.yaml +++ b/openapi/go-client-generated/api/swagger.yaml @@ -1575,6 +1575,13 @@ components: - Executed - Sealed - Expired + BlockStatus: + type: string + description: This value indicates the status of a block. + enum: + - BLOCK_UNKNOWN + - BLOCK_FINALIZED + - BLOCK_SEALED Block: required: - block_status @@ -1592,9 +1599,9 @@ components: _links: $ref: '#/components/schemas/Links' block_status: - type: string + $ref: '#/components/schemas/BlockStatus' example: - block_status: block_status + block_status: BLOCK_UNKNOWN payload: collection_guarantees: - collection_id: null diff --git a/openapi/go-client-generated/docs/Block.md b/openapi/go-client-generated/docs/Block.md index 9ccadf117..df6f38706 100644 --- a/openapi/go-client-generated/docs/Block.md +++ b/openapi/go-client-generated/docs/Block.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **ExecutionResult** | [***ExecutionResult**](ExecutionResult.md) | | [optional] [default to null] **Expandable** | [***BlockExpandable**](Block__expandable.md) | | [optional] [default to null] **Links** | [***Links**](Links.md) | | [optional] [default to null] -**BlockStatus** | **string** | | [default to null] +**BlockStatus** | [***BlockStatus**](BlockStatus.md) | | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/openapi/go-client-generated/docs/BlockStatus.md b/openapi/go-client-generated/docs/BlockStatus.md new file mode 100644 index 000000000..a9902ef39 --- /dev/null +++ b/openapi/go-client-generated/docs/BlockStatus.md @@ -0,0 +1,8 @@ +# BlockStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/openapi/go-client-generated/model_block.go b/openapi/go-client-generated/model_block.go index 48d8addc7..158b7b6b1 100644 --- a/openapi/go-client-generated/model_block.go +++ b/openapi/go-client-generated/model_block.go @@ -14,5 +14,5 @@ type Block struct { ExecutionResult *ExecutionResult `json:"execution_result,omitempty"` Expandable *BlockExpandable `json:"_expandable,omitempty"` Links *Links `json:"_links,omitempty"` - BlockStatus string `json:"block_status"` + BlockStatus *BlockStatus `json:"block_status"` } diff --git a/openapi/go-client-generated/model_block_status.go b/openapi/go-client-generated/model_block_status.go new file mode 100644 index 000000000..018c8348b --- /dev/null +++ b/openapi/go-client-generated/model_block_status.go @@ -0,0 +1,18 @@ +/* + * Access API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger +// BlockStatus : This value indicates the status of a block. +type BlockStatus string + +// List of BlockStatus +const ( + UNKNOWN_BlockStatus BlockStatus = "BLOCK_UNKNOWN" + FINALIZED_BlockStatus BlockStatus = "BLOCK_FINALIZED" + SEALED_BlockStatus BlockStatus = "BLOCK_SEALED" +) From ff0760f951bea16b0a90cd78d5537f0d6c142e53 Mon Sep 17 00:00:00 2001 From: Andrii Slisarchuk Date: Thu, 23 Jan 2025 14:39:54 +0200 Subject: [PATCH 4/5] changed enum values --- openapi/access.yaml | 6 +++--- openapi/go-client-generated/api/swagger.yaml | 8 ++++---- openapi/go-client-generated/model_block_status.go | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openapi/access.yaml b/openapi/access.yaml index e60edecab..518beb9d6 100644 --- a/openapi/access.yaml +++ b/openapi/access.yaml @@ -937,9 +937,9 @@ components: type: string description: This value indicates the status of a block. enum: - - BLOCK_UNKNOWN - - BLOCK_FINALIZED - - BLOCK_SEALED + - Unknown + - Finalized + - Sealed Block: type: object required: diff --git a/openapi/go-client-generated/api/swagger.yaml b/openapi/go-client-generated/api/swagger.yaml index 8cad874e7..379765350 100644 --- a/openapi/go-client-generated/api/swagger.yaml +++ b/openapi/go-client-generated/api/swagger.yaml @@ -1579,9 +1579,9 @@ components: type: string description: This value indicates the status of a block. enum: - - BLOCK_UNKNOWN - - BLOCK_FINALIZED - - BLOCK_SEALED + - Unknown + - Finalized + - Sealed Block: required: - block_status @@ -1601,7 +1601,7 @@ components: block_status: $ref: '#/components/schemas/BlockStatus' example: - block_status: BLOCK_UNKNOWN + block_status: Unknown payload: collection_guarantees: - collection_id: null diff --git a/openapi/go-client-generated/model_block_status.go b/openapi/go-client-generated/model_block_status.go index 018c8348b..bb351cdc4 100644 --- a/openapi/go-client-generated/model_block_status.go +++ b/openapi/go-client-generated/model_block_status.go @@ -12,7 +12,7 @@ type BlockStatus string // List of BlockStatus const ( - UNKNOWN_BlockStatus BlockStatus = "BLOCK_UNKNOWN" - FINALIZED_BlockStatus BlockStatus = "BLOCK_FINALIZED" - SEALED_BlockStatus BlockStatus = "BLOCK_SEALED" + UNKNOWN_BlockStatus BlockStatus = "Unknown" + FINALIZED_BlockStatus BlockStatus = "Finalized" + SEALED_BlockStatus BlockStatus = "Sealed" ) From e797132bf24e8580e75fabfa13f6a38091cf891b Mon Sep 17 00:00:00 2001 From: Andrii Slisarchuk Date: Thu, 23 Jan 2025 14:47:38 +0200 Subject: [PATCH 5/5] return back enum values, due to current block status string used in rest api --- openapi/access.yaml | 6 +++--- openapi/go-client-generated/api/swagger.yaml | 8 ++++---- openapi/go-client-generated/model_block_status.go | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openapi/access.yaml b/openapi/access.yaml index 518beb9d6..e60edecab 100644 --- a/openapi/access.yaml +++ b/openapi/access.yaml @@ -937,9 +937,9 @@ components: type: string description: This value indicates the status of a block. enum: - - Unknown - - Finalized - - Sealed + - BLOCK_UNKNOWN + - BLOCK_FINALIZED + - BLOCK_SEALED Block: type: object required: diff --git a/openapi/go-client-generated/api/swagger.yaml b/openapi/go-client-generated/api/swagger.yaml index 379765350..8cad874e7 100644 --- a/openapi/go-client-generated/api/swagger.yaml +++ b/openapi/go-client-generated/api/swagger.yaml @@ -1579,9 +1579,9 @@ components: type: string description: This value indicates the status of a block. enum: - - Unknown - - Finalized - - Sealed + - BLOCK_UNKNOWN + - BLOCK_FINALIZED + - BLOCK_SEALED Block: required: - block_status @@ -1601,7 +1601,7 @@ components: block_status: $ref: '#/components/schemas/BlockStatus' example: - block_status: Unknown + block_status: BLOCK_UNKNOWN payload: collection_guarantees: - collection_id: null diff --git a/openapi/go-client-generated/model_block_status.go b/openapi/go-client-generated/model_block_status.go index bb351cdc4..018c8348b 100644 --- a/openapi/go-client-generated/model_block_status.go +++ b/openapi/go-client-generated/model_block_status.go @@ -12,7 +12,7 @@ type BlockStatus string // List of BlockStatus const ( - UNKNOWN_BlockStatus BlockStatus = "Unknown" - FINALIZED_BlockStatus BlockStatus = "Finalized" - SEALED_BlockStatus BlockStatus = "Sealed" + UNKNOWN_BlockStatus BlockStatus = "BLOCK_UNKNOWN" + FINALIZED_BlockStatus BlockStatus = "BLOCK_FINALIZED" + SEALED_BlockStatus BlockStatus = "BLOCK_SEALED" )