Skip to content

feat: support external $ref resolution in OpenAPI loader #130

@rohilsurana

Description

@rohilsurana

Problem

`src/lib/openapi.ts` only resolves internal `#/` JSON pointer references. External file references (e.g. `$ref: './common/errors.yaml'`) fail silently, resulting in unresolved `$ref` objects appearing in the rendered API docs.

The V2→V3 conversion is also incomplete:

  • Ignores `consumes`/`produces` fields (assumes JSON for everything)
  • Doesn't convert all security scheme types
  • Missing request/response examples

Suggested Fix

  • For external file refs, resolve relative to the spec file's directory
  • For the V2 conversion, carry over `consumes`/`produces` as content type entries in V3 request/response objects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions