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

Added OclEnumDefaultValueAttribute #134

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

stevencl840
Copy link
Contributor

@stevencl840 stevencl840 commented Apr 22, 2024

Background

We have found a scenario where an enum has a default value, but the class that uses the enum has a different value than the default value of the property. In this case, the OCL Attribute will be produced when the property is unchanged. The OCL Attribute will be skipped when the value of the property matches the default value of the Enum(but not the default value of the object being converted)

Result

This PR adds a solution. By allowing a developer to specify a default value for an enum field via an attribute, the OCL converter can perform correctly when serializing these values.

@stevencl840 stevencl840 marked this pull request as ready for review April 22, 2024 04:47
@stevencl840 stevencl840 changed the title Added OclEnumDefaultValueAttribute and tests Added OclEnumDefaultValueAttribute Apr 22, 2024
@stevencl840 stevencl840 merged commit 2e94969 into main Apr 22, 2024
3 checks passed
@stevencl840 stevencl840 deleted the sjc/add-enum-default-attribute branch April 22, 2024 22:08
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