Skip to content

Error: the Subschemas of the schema must use $ref. Inline subschemas are not allowed. #730

@quantumcoinproject

Description

@quantumcoinproject

Describe the bug
When trying to build a client for the spec, we get a compilation error. The doc build succeeds though.

To Reproduce
Steps to reproduce the behavior:

  1. Download https://github.com/quantumcoinproject/api-doc/releases/download/v0.0.2/openrpc.json
  2. Download https://github.com/quantumcoinproject/api-doc/releases/download/v0.0.2/open-rpc-generator-config-client.json
  3. Install latest version of openrpc-generator: npm i @open-rpc/generator
  4. Run: open-rpc-generator generate -c open-rpc-generator-config-client.json
  5. See error
    Error: the Subschemas of the schema must use $ref. Inline subschemas are not allowed.

The spec should have compiled successfully. The specific part of the spec where this occurs is:
"name": "Transaction information". The properties blockHash, blockNumber in this part of the spec is causing the issue.

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

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
There are other similar issues in openapi generator (different from openrpc generator) but with same error:
OpenAPITools/openapi-generator#7262

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions