Skip to content

Commit 9eef7d2

Browse files
committed
fix: expose fetch error in /governance/dreps/:drep_id/metadata
1 parent 5cb5c7b commit 9eef7d2

File tree

11 files changed

+172
-10
lines changed

11 files changed

+172
-10
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,26 @@ Unreleased changes are in the `master` branch.
99

1010
## [Unreleased]
1111

12+
## [0.1.84] - 2025-11-27
13+
14+
### Added
15+
16+
- Exposed off-chain metadata fetch errors in metadata responses in `/governance/dreps/:drep_id/metadata`
17+
- Error object structure:
18+
```ts
19+
{
20+
"code": "HASH_MISMATCH" | "CONNECTION_ERROR" | "HTTP_RESPONSE_ERROR" | "DECODE_ERROR" | "SIZE_EXCEEDED" | "UNKNOWN_ERROR",
21+
"message": "Human-readable description of the error"
22+
}
23+
```
24+
- If metadata are available, the `error` field is omitted
25+
1226
## [0.1.83] - 2025-11-25
1327

1428
### Fixed
1529

1630
- `/network/eras` number format
17-
- added PlutusV3 to the type field of the script object, to match the actual API response types
31+
- Added PlutusV3 to the type field of the script object, to match the actual API response types
1832

1933
## [0.1.82] - 2025-10-20
2034

blockfrost-openapi.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: 3.0.0
22
info:
3-
version: 0.1.83
3+
version: 0.1.84
44
title: Blockfrost.io ~ API Documentation
55
x-logo:
66
url: https://staging.blockfrost.io/images/logo.svg
@@ -6840,6 +6840,27 @@ components:
68406840
bytes:
68416841
type: string
68426842
description: Content of the metadata (raw)
6843+
nullable: true
6844+
error:
6845+
type: object
6846+
description: Present when metadata could not be fetched or validated.
6847+
properties:
6848+
code:
6849+
type: string
6850+
description: Stable machine-readable error code.
6851+
enum:
6852+
- HASH_MISMATCH
6853+
- CONNECTION_ERROR
6854+
- HTTP_RESPONSE_ERROR
6855+
- DECODE_ERROR
6856+
- SIZE_EXCEEDED
6857+
- UNKNOWN_ERROR
6858+
message:
6859+
type: string
6860+
description: Human-readable description of the error.
6861+
required:
6862+
- code
6863+
- message
68436864
required:
68446865
- drep_id
68456866
- hex

docs/blockfrost-openapi.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: 3.0.3
22
info:
3-
version: 0.1.83
3+
version: 0.1.84
44
title: Blockfrost.io ~ API Documentation
55
x-logo:
66
url: 'https://staging.blockfrost.io/images/logo.svg'
@@ -7174,6 +7174,27 @@ components:
71747174
bytes:
71757175
type: string
71767176
description: Content of the metadata (raw)
7177+
nullable: true
7178+
error:
7179+
type: object
7180+
description: Present when metadata could not be fetched or validated.
7181+
properties:
7182+
code:
7183+
type: string
7184+
description: Stable machine-readable error code.
7185+
enum:
7186+
- HASH_MISMATCH
7187+
- CONNECTION_ERROR
7188+
- HTTP_RESPONSE_ERROR
7189+
- DECODE_ERROR
7190+
- SIZE_EXCEEDED
7191+
- UNKNOWN_ERROR
7192+
message:
7193+
type: string
7194+
description: Human-readable description of the error.
7195+
required:
7196+
- code
7197+
- message
71777198
required:
71787199
- drep_id
71797200
- hex

json-schema.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

openapi.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"openapi": "3.0.3",
33
"info": {
4-
"version": "0.1.83",
4+
"version": "0.1.84",
55
"title": "Blockfrost.io ~ API Documentation",
66
"x-logo": {
77
"url": "https://staging.blockfrost.io/images/logo.svg",
@@ -9425,7 +9425,34 @@
94259425
},
94269426
"bytes": {
94279427
"type": "string",
9428-
"description": "Content of the metadata (raw)"
9428+
"description": "Content of the metadata (raw)",
9429+
"nullable": true
9430+
},
9431+
"error": {
9432+
"type": "object",
9433+
"description": "Present when metadata could not be fetched or validated.",
9434+
"properties": {
9435+
"code": {
9436+
"type": "string",
9437+
"description": "Stable machine-readable error code.",
9438+
"enum": [
9439+
"HASH_MISMATCH",
9440+
"CONNECTION_ERROR",
9441+
"HTTP_RESPONSE_ERROR",
9442+
"DECODE_ERROR",
9443+
"SIZE_EXCEEDED",
9444+
"UNKNOWN_ERROR"
9445+
]
9446+
},
9447+
"message": {
9448+
"type": "string",
9449+
"description": "Human-readable description of the error."
9450+
}
9451+
},
9452+
"required": [
9453+
"code",
9454+
"message"
9455+
]
94299456
}
94309457
},
94319458
"required": [

openapi.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: 3.0.3
22
info:
3-
version: 0.1.83
3+
version: 0.1.84
44
title: Blockfrost.io ~ API Documentation
55
x-logo:
66
url: 'https://staging.blockfrost.io/images/logo.svg'
@@ -7174,6 +7174,27 @@ components:
71747174
bytes:
71757175
type: string
71767176
description: Content of the metadata (raw)
7177+
nullable: true
7178+
error:
7179+
type: object
7180+
description: Present when metadata could not be fetched or validated.
7181+
properties:
7182+
code:
7183+
type: string
7184+
description: Stable machine-readable error code.
7185+
enum:
7186+
- HASH_MISMATCH
7187+
- CONNECTION_ERROR
7188+
- HTTP_RESPONSE_ERROR
7189+
- DECODE_ERROR
7190+
- SIZE_EXCEEDED
7191+
- UNKNOWN_ERROR
7192+
message:
7193+
type: string
7194+
description: Human-readable description of the error.
7195+
required:
7196+
- code
7197+
- message
71777198
required:
71787199
- drep_id
71797200
- hex

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockfrost/openapi",
3-
"version": "0.1.83",
3+
"version": "0.1.84",
44
"description": "OpenAPI specifications for blockfrost.io",
55
"repository": "git@github.com:blockfrost/openapi.git",
66
"author": "admin@blockfrost.io",

src/definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: 3.0.0
22
info:
3-
version: 0.1.83
3+
version: 0.1.84
44
title: Blockfrost.io ~ API Documentation
55
x-logo:
66
url: https://staging.blockfrost.io/images/logo.svg

src/generated-types.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7342,7 +7342,17 @@ export interface components {
73427342
[key: string]: unknown;
73437343
} | unknown[] | number | boolean | null;
73447344
/** @description Content of the metadata (raw) */
7345-
bytes: string;
7345+
bytes: string | null;
7346+
/** @description Present when metadata could not be fetched or validated. */
7347+
error?: {
7348+
/**
7349+
* @description Stable machine-readable error code.
7350+
* @enum {string}
7351+
*/
7352+
code: "HASH_MISMATCH" | "CONNECTION_ERROR" | "HTTP_RESPONSE_ERROR" | "DECODE_ERROR" | "SIZE_EXCEEDED" | "UNKNOWN_ERROR";
7353+
/** @description Human-readable description of the error. */
7354+
message: string;
7355+
};
73467356
};
73477357
/** @example [
73487358
* {

src/schemas/governance/drep_metadata.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,27 @@ properties:
2929
bytes:
3030
type: string
3131
description: Content of the metadata (raw)
32+
nullable: true
33+
error:
34+
type: object
35+
description: Present when metadata could not be fetched or validated.
36+
properties:
37+
code:
38+
type: string
39+
description: Stable machine-readable error code.
40+
enum:
41+
- HASH_MISMATCH
42+
- CONNECTION_ERROR
43+
- HTTP_RESPONSE_ERROR
44+
- DECODE_ERROR
45+
- SIZE_EXCEEDED
46+
- UNKNOWN_ERROR
47+
message:
48+
type: string
49+
description: Human-readable description of the error.
50+
required:
51+
- code
52+
- message
3253
required:
3354
- drep_id
3455
- hex

0 commit comments

Comments
 (0)