Skip to content

Commit

Permalink
fix: update meta-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Oct 30, 2020
1 parent e662f5f commit 6b4d47e
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 39 deletions.
138 changes: 107 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"@monaco-editor/react": "^2.3.0",
"@open-rpc/client-js": "^1.3.1",
"@open-rpc/logs-react": "^1.1.13",
"@open-rpc/meta-schema": "^1.7.0",
"@open-rpc/schema-utils-js": "^1.12.0",
"@open-rpc/meta-schema": "^1.13.20",
"@open-rpc/schema-utils-js": "^1.14.0",
"@rehooks/window-size": "^1.0.2",
"acorn-dynamic-import": "^4.0.0",
"monaco-editor": "^0.18.1",
Expand Down
16 changes: 10 additions & 6 deletions src/helpers/openrpcDocumentToJSONRPCSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ const openrpcDocumentToJSONRPCSchema = (openrpcDocument: OpenrpcDocument) => {
type: "object",
properties: method.params && (method.params as ContentDescriptorObject[])
.reduce((memo: any, param: ContentDescriptorObject) => {
memo[param.name] = {
...param.schema,
markdownDescription: param.description || param.summary,
description: param.description || param.summary,
additionalProperties: false,
};
if (typeof param.schema === "object") {
memo[param.name] = {
...param.schema,
markdownDescription: param.description || param.summary,
description: param.description || param.summary,
additionalProperties: false,
};
} else {
memo[param.name] = param.schema;
}
return memo;
}, {}),
},
Expand Down

0 comments on commit 6b4d47e

Please sign in to comment.