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: generator can handle enum type with one member #699

Merged
merged 4 commits into from
Nov 11, 2020
Merged

Conversation

jjtang1985
Copy link
Contributor

@jjtang1985 jjtang1985 commented Nov 10, 2020

This PR will fix the issue reported here, where the generator fails when it detects a enum type with one element.

const types: EdmxEnumType[] = forceArray(root.EnumType);
return types.map(edmxEnumType => ({
Name: edmxEnumType.Name,
Member: forceArray(edmxEnumType.Member)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there is only one member, the type of the Member is an object instead of an array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is essentially the fix, right? ;)

@jjtang1985 jjtang1985 marked this pull request as ready for review November 11, 2020 08:19
Copy link
Contributor

@marikaner marikaner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const types: EdmxEnumType[] = forceArray(root.EnumType);
return types.map(edmxEnumType => ({
Name: edmxEnumType.Name,
Member: forceArray(edmxEnumType.Member)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is essentially the fix, right? ;)

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