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

fix: correctly handle enums without type properties #814

Merged
merged 2 commits into from
Apr 8, 2023

Conversation

anzev
Copy link
Contributor

@anzev anzev commented Mar 30, 2023

Status

WIP

Description

This fixes the issue described in #750, as we have also encountered the issue in our use case. The fix is a one-liner.

I would be grateful for any feedback and info on what is still needed to get this fix into a release. Thanks!

Related PRs

/

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

I have added two previously failing examples to null-type.yaml.

    NullEnum:
      enum:
        - null
    BlankEnum:
      enum:
        - ''

These are now correctly transformed into:

export const NullEnum = {
  null: 'null',
} as const;

and

export const BlankEnum = {
  '': '',
} as const;

@vercel
Copy link

vercel bot commented Mar 30, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @anymaniax on Vercel.

@anymaniax first needs to authorize it.

@anzev anzev marked this pull request as draft March 30, 2023 14:46
@anzev anzev marked this pull request as ready for review March 31, 2023 12:44
@anymaniax anymaniax merged commit daf83a5 into orval-labs:master Apr 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants