Skip to content

Commit

Permalink
fix validate metadata example
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysu committed Sep 18, 2023
1 parent 45c5d9b commit 8dd3913
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/node/scripts/publication/validateMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ async function main() {

const metadata = {};

const result = await client.publication.validateMetadata(metadata);
const result = await client.publication.validateMetadata({
json: JSON.stringify(metadata),
});

if (!result.valid) {
throw new Error(`Metadata is not valid because of ${result.reason}`);
Expand Down
4 changes: 3 additions & 1 deletion packages/client/src/submodules/publication/Publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ export class Publication {
*
* @example
* ```ts
* const result = await client.publication.validateMetadata(metadata);
* const result = await client.publication.validateMetadata({
* json: JSON.stringify(metadata),
* });
*
* if (!result.valid) {
* throw new Error(`Metadata is not valid because of ${result.reason}`);
Expand Down

0 comments on commit 8dd3913

Please sign in to comment.