Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixes #1636 Fixes "blank" enums by providing the fallback name#1829

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lesha-co wants to merge1 commit intoferdikoomen:main
base:main
Choose a base branch
Loading
fromlesha-co:fix-blank-enums

Conversation

@lesha-co
Copy link

@lesha-colesha-co commentedOct 12, 2023
edited
Loading

Fixes issue#1636

Some frameworks (e.g. django rest framework, I guess) generate following schema:

openapi: 3.0.3info:    version: 1.0.0components:    schemas:        BlankEnum:            enum:                - ''

right now this library generates invalid typescript:

export enum BlankEnum {     = '',}

This happens ingetEnum functions that don't check for invalid input (getEnum([''])) in our case.

I decided to give such enum valuesBLANK name so that generated files are correct

export enum BlankEnum {    BLANK = '',}

Not sure if it would be a better idea to just omit these values (I mean, the name saysBlankEnum) but everything's better than broken syntax

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@lesha-co

[8]ページ先頭

©2009-2025 Movatter.jp