Though the config in open-rpc-generator-config.json works fine (it builds target docs) when I run
open-rpc-generator generate -t client -l typescript -d openrpc.json -o ./generated-client it returns the following error:
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/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:91:19)
at /Users/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/codegens/typescript.js:122:50
at Array.reduce (<anonymous>)
at Typescript.handleObject (/Users/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/codegens/typescript.js:116:51)
at CodeGen.toIR (/Users/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:140:29)
at /Users/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:53:32
at Array.forEach (<anonymous>)
at CodeGen.transpile (/Users/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/codegens/codegen.js:51:18)
at Transpiler.transpile (/Users/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/index.js:140:28)
at Transpiler.toTypescript (/Users/igor/.npm-packages/lib/node_modules/@open-rpc/generator/node_modules/@json-schema-tools/transpiler/build/index.js:49:21)
Is the spec intended to produce working client/server code? Does anyone use the spec that way? Thanks.
Though the config in open-rpc-generator-config.json works fine (it builds target
docs
) when I runopen-rpc-generator generate -t client -l typescript -d openrpc.json -o ./generated-client
it returns the following error:Is the spec intended to produce working client/server code? Does anyone use the spec that way? Thanks.