|
1 |
| -# `xyz.taluslabs.storage.walrus.upload-json` |
| 1 | +# `xyz.taluslabs.storage.walrus.upload-json@1` |
2 | 2 |
|
3 | 3 | Standard Nexus Tool that uploads a JSON file to Walrus and returns the blob ID.
|
4 | 4 |
|
@@ -54,3 +54,50 @@ The blob upload failed.
|
54 | 54 | - **`err.status_code`: [`Option<u16>`]** - HTTP status code if available (for network errors)
|
55 | 55 |
|
56 | 56 | ---
|
| 57 | + |
| 58 | +# `xyz.taluslabs.storage.walrus.read-json@1` |
| 59 | + |
| 60 | +Standard Nexus Tool that reads a JSON file from Walrus and returns the JSON data. The tool can also validate the JSON data against a provided schema. |
| 61 | + |
| 62 | +## Input |
| 63 | + |
| 64 | +**`blob_id`: [`String`]** |
| 65 | + |
| 66 | +The blob ID of the JSON file to read. |
| 67 | + |
| 68 | +_opt_ **`aggregator_url`: [`Option<String>`]** _default_: [`None`] |
| 69 | + |
| 70 | +The URL of the Walrus aggregator to read the JSON from. |
| 71 | + |
| 72 | +_opt_ **`json_schema`: [`Option<WalrusJsonSchema>`]** _default_: [`None`] |
| 73 | + |
| 74 | +Optional JSON schema to validate the data against. |
| 75 | + |
| 76 | +### WalrusJsonSchema Structure |
| 77 | + |
| 78 | +- **`name`: [`String`]** - The name of the schema. Must match `[a-zA-Z0-9-_]`, with a maximum length of 64. |
| 79 | +- **`schema`: [`schemars::Schema`]** - The JSON schema for the expected output. |
| 80 | +- **`description`: [`Option<String>`]** - A description of the expected format. |
| 81 | +- **`strict`: [`Option<bool>`]** - Whether to enable strict schema adherence when validating the output. |
| 82 | + |
| 83 | +## Output Variants & Ports |
| 84 | + |
| 85 | +**`ok`** |
| 86 | + |
| 87 | +The JSON data was read successfully. |
| 88 | + |
| 89 | +- **`ok.json`: [`Value`]** - The JSON data as a structured value |
| 90 | + |
| 91 | +**`err`** |
| 92 | + |
| 93 | +The JSON read operation failed. |
| 94 | + |
| 95 | +- **`err.reason`: [`String`]** - A detailed error message describing what went wrong |
| 96 | +- **`err.kind`: [`ReadErrorKind`]** - Type of error that occurred |
| 97 | + - Possible kinds: |
| 98 | + - `network` - Error during HTTP requests or network connectivity issues |
| 99 | + - `validation` - Invalid JSON data format or parsing failures |
| 100 | + - `schema` - Error validating the JSON against the provided schema |
| 101 | +- **`err.status_code`: [`Option<u16>`]** - HTTP status code if available (for network errors) |
| 102 | + |
| 103 | +--- |
0 commit comments