Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect schema output when using Record #547

Open
bdarcus opened this issue May 25, 2023 · 1 comment
Open

Incorrect schema output when using Record #547

bdarcus opened this issue May 25, 2023 · 1 comment

Comments

@bdarcus
Copy link

bdarcus commented May 25, 2023

EDIT: maybe a dup of #476 and #337?


As I mentioned here, I tried to switch to the other converter, but ran into a showstopper of a bug.

So far, the only little issue I have here is this, which I'd like to resolve.

The code:

/** A global template that can be referenced by unique key. */
export type NamedTemplate = Record<TemplateKey, InlineTemplate>;

/** Template property definition in the Style. */
export interface TopLevelTemplate {
  templates: NamedTemplate;
}

Here's what it currently generates:

        "NamedTemplate": {
            "description": "A global template that can be referenced by unique key.",
            "type": "object"
        },

Here's what it should (I think?):

        "NamedTemplate": {
            "description": "A global template that can be referenced by unique key.",
            "type": "object",
            "$ref": "#/definitions/InlineTemplate"
        },

Edit: actually, output needs to use a patternProperty.

So why is the ref not added?

Is there anything I can do on my end to get this to work correctly?

@bdarcus bdarcus changed the title Missing ref? Missing ref when using Record May 25, 2023
@bdarcus bdarcus changed the title Missing ref when using Record Incorrect schema output when using Record May 25, 2023
@dht
Copy link

dht commented Jun 9, 2023

#337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants