Skip to content

[DOCS-5092] [CLI] Merge does not handle exteral $ref's #1416

Description

@philsturgeon

When running merge command on

speakeasy merge -s ~/src/train-travel-api/openapi.yaml -s ~/src/examples-examples/oas3.yaml

This creates the following error:

component ./models/todo-full.v1.json does not exist in the specification

Full output:

  Values for 1 field has been supplied ✔

  Values for 1 field has been supplied ✔


Running command speakeasy merge --schemas=[/Users/phil/src/bump/train-travel-api/openapi.yaml,/Users/phil/src/examples-examples/oas3.yaml] --out=test.yaml

Validating OpenAPI spec /Users/phil/src/bump/train-travel-api/openapi.yaml...

INFO    Using ruleset speakeasy-recommended
Lint report available to view at: https://app.speakeasy.com/org/protectearth/protectearth/linting-report/da3eeca96c5039f91a66edfc040ca975
WARN    validation warn: [line 29] oas3-host-not-example - Server URL should not point at example.com: matches the expression example\.com
Successfully validated /Users/phil/src/bump/train-travel-api/openapi.yaml
Validating OpenAPI spec /Users/phil/src/examples-examples/oas3.yaml...

INFO    Using ruleset speakeasy-recommended
Lint report available to view at: https://app.speakeasy.com/org/protectearth/protectearth/linting-report/4155c979bab17266809c505d3fa211fe
Successfully validated /Users/phil/src/examples-examples/oas3.yaml
{"time":"2025-05-12T14:12:43.498087+01:00","level":"ERROR","msg":"unable to open the rolodex file, check specification references and base path","file":"/Users/phil/src/speakeasy/developer-docs/models/todo-full.v1.json","error":"open /Users/phil/src/speakeasy/developer-docs/models/todo-full.v1.json: no such file or directory"}
{"time":"2025-05-12T14:12:43.499571+01:00","level":"ERROR","msg":"error building path item: schema build failed: reference './models/todo-full.v1.json' cannot be found at line 265, col 23"}
component ./models/todo-full.v1.json does not exist in the specification

I know merge has a different use case to bundling but if it cant pull in a ref then it should ignore it, allowing the main openapi files to be merged then point to that $ref which is hopefully still in the same folder.

Screenshots

Image Image

DOCS-5092

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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