Skip to content

Importing external refs from url #1426

@si-fernandes

Description

@si-fernandes

Hello,

I'm trying to generate Go code from a spec that contains a reference to an external spec on GitHub, like this:

        MetadataTensor: 
            $ref: "https://raw.githubusercontent.com/kserve/open-inference-protocol/ff934734c2675b80102abdeb9c2ea2d712026a41/specification/protocol/open_inference_rest.yaml#/components/schemas/metadata_tensor"

When I run the generate command, I get the following error:
error generating code: error generating type definitions: error generating Go types for component schemas: error converting Schema MetadataTensor to Go type: error turning reference (https://raw.githubusercontent.com/kserve/open-inference-protocol/ff934734c2675b80102abdeb9c2ea2d712026a41/specification/protocol/open_inference_rest.yaml#/components/schemas/metadata_tensor) into a Go type: unrecognized external reference 'https://raw.githubusercontent.com/kserve/open-inference-protocol/ff934734c2675b80102abdeb9c2ea2d712026a41/specification/protocol/open_inference_rest.yaml'; please provide the known import for this reference using option --import-mapping

I have tried to provide a mapping through the import-mapping flag but without success.
Is there are guidance you can provide in the matter or is this something that has not been implemented?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:external-refsAnything related to external references (referencing other file(s) within a spec)documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions