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

additionalProps type evalulation seems to have issues #215

Open
PeterMK85 opened this issue Aug 22, 2023 · 0 comments
Open

additionalProps type evalulation seems to have issues #215

PeterMK85 opened this issue Aug 22, 2023 · 0 comments

Comments

@PeterMK85
Copy link
Contributor

PeterMK85 commented Aug 22, 2023

Describe the bug
With --export-types options the following declarations:

    Order:
      type: object
      additionalProperties:
          type: string

!Note: no properties defined

Will evaluate to:

type Order = {}

I think it should be:
Easy fix:

type Order = {[key: string]: string}

Or

type Order = Record<string, string>

As a workaround, I tried the following:

    Order:
      type: object
      properties: {}
      additionalProperties:
          type: string

Which yields to:

type Order = Partial<{} & {[key: string]: string}>

Minimal reproduction
Online example
(Modified the Order)

Expected behavior
I have a local patch to make it work I will open a PR today.

Additional context
Rootcause

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

1 participant