-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
feat!: properly implement constants in c# #1801
Conversation
✅ Deploy Preview for modelina canceled.
|
Pull Request Test Coverage Report for Build 7913235475Details
💛 - Coveralls |
I think we have to do this change on the On top of that it will break people's existing usage of the models. @moritzkalwa do you mind adding an entry in the migration guide ✌️ |
Similar to #1799 |
@jonaslagoni No, I can definitely add a migration guide for this. I probably won't have the time for it until Friday though. |
No worries, no rush ✌️ |
Changed the target branch to |
If you point me to the correct place I might be able to adapt the serializers right in this PR / add a second PR before we merge this one? |
You have the presets here: https://github.com/asyncapi/modelina/blob/master/src/generators/csharp/presets/JsonSerializerPreset and https://github.com/asyncapi/modelina/blob/master/src/generators/csharp/presets/NewtonsoftSerializerPreset.ts I think you only need to make changes to renderSerializeProperty and renderDeserializeProperty and check whether the model has a constant value, if so, dont serialize what you get, just set it 🙂 |
Im still trying to understand the serializer so forgive me if this is a dumb question, but do we really need to change the |
Most likely correct @moritzkalwa 👍 you can use the runtime test to ensure it works 😄 |
a711688
to
abd2fab
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing @moritzkalwa 🔥
/rtm |
🎉 This PR is included in version 4.0.0-next.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Enable the C# Class and Record Generators to properly handle constant values.
Related Issue
fixes #1471
Checklist
npm run lint
).npm run test
).