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

[Feature] --union-enums CLI option #61

Merged
merged 5 commits into from
Jun 26, 2020
Merged

[Feature] --union-enums CLI option #61

merged 5 commits into from
Jun 26, 2020

Conversation

js2me
Copy link
Member

@js2me js2me commented Jun 25, 2020

Add new CLI option - --union-enums.
This option allows to generate all enums as union types.
#58

For example, schema part:

"StringEnum": {
  "enum": ["String1", "String2", "String3", "String4"],
  "type": "string"
}

will be converted into:
export type StringEnum = "String1" | "String2" | "String3" | "String4";

@js2me js2me linked an issue Jun 25, 2020 that may be closed by this pull request
@js2me js2me force-pushed the feature/union-enums branch from 04c3073 to 244e50e Compare June 26, 2020 21:09
@js2me js2me merged commit 0e0a9d6 into next Jun 26, 2020
js2me added a commit that referenced this pull request Jun 26, 2020
* feat: add --union-enums cli option which generate all enums as union types

* docs: update README, CHANGELOG

* chore(fix): manual test for union enums option
js2me added a commit that referenced this pull request Jun 26, 2020
* Custom template (#60)

* feat: allow to provide custom templates

* internal: add manual test script for custom templates option

* feat: resolving paths to templates

* internal: adjust test for custom templates

Co-authored-by: Volkov Sergey <js2me@outlook.com>
Co-authored-by: Filimonov Andrey <andrefilimono@gmail.com>

* [Feature] `--union-enums` CLI option (#61)

* feat: add --union-enums cli option which generate all enums as union types

* docs: update README, CHANGELOG

* chore(fix): manual test for union enums option

* docs: update CHANGELOG; bump: up version to 1.10.0

Co-authored-by: Filimonov Andrey <andrefilimono@gmail.com>
@js2me js2me deleted the feature/union-enums branch January 12, 2021 12:15
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.

String enums
1 participant