Closed odanado closed 2 years ago
The specs have changed quite a bit since this issue, and we now have some CI checks using some open-rpc tools to verify the spec. If you're still having a problem, please open a new issue.
i just ran into this...
~/Code/node/api main !3 ?1 ❯ open-rpc-generator generate -t server -l typescript -n eth-node -d execution-apis/openrpc.json -o ./generated-server 14:56:31
(node:17436) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[
'One of the provided schemas is using an array for the field type. This is not',
'advisable, as oneOf is the equivalent. In (far) future releases, type as an array',
'support will be deprecated.'
]
[
'One of the provided schemas is using an array for the field type. This is not',
'advisable, as oneOf is the equivalent. In (far) future releases, type as an array',
'support will be deprecated.'
]
There was error at generator runtime:
Error: the Subschemas of the schema must use $ref. Inline subschemas are not allowed.
the schema in question:
{"title":"block hash","type":"string","pattern":"^0x[0-9a-f]{64}$"}
at CodeGen.refToTitle (/Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:91:19)
at /Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/codegens/typescript.js:122:50
at Array.reduce (<anonymous>)
at Typescript.handleObject (/Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/codegens/typescript.js:116:51)
at CodeGen.toIR (/Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:140:29)
at /Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:53:32
at Array.forEach (<anonymous>)
at CodeGen.transpile (/Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:51:18)
at Transpiler.transpile (/Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/index.js:140:28)
at Transpiler.toTypescript (/Users/l1jxk15/.config/yarn/global/node_modules/@json-schema-tools/transpiler/build/index.js:49:21)
I tried to use the @open-rpc/generator to generate the source code for the client. As a result, I got the following error.
Reproduction repository: https://github.com/odan-sandbox/ethereum-open-rpc-generator-sandbox