-
Notifications
You must be signed in to change notification settings - Fork 117
Add C# Support #155
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
base: main
Are you sure you want to change the base?
Add C# Support #155
Conversation
08c1488
to
98e6e28
Compare
👋🏼 We're currently holding off on including support for new languages as we're in the process of a large refactor to modularize languages. |
No worries. Yes, I've seen many changes and I am trying to keep up with them so the PR can be reviewed when you have a chance. What would be the rough timeline of the refactoring? Is there anything I could do to help get this in? |
Hi @dandro, thank you so much for this contribution! My apologies for the long turnaround on this. I am a developer at 1Password and am part of the team that has authored the Python and Go Typeshare implementations (also being a heavy consumer of the Typescript Typeshare). I'm super excited to work with you on this, after I get a bit more familiar with the C# conventions. To help move this forward, a few ideas around the notes in your PR description:
(example for when a This would be similar to what we do in Go with the struct tags.
and for each type alias defined, to create a specialized instance of this:
I'm happy to help delve into each of these options. 😄 As I mentioned, I'm not very familiar with C# and what makes sense here, but I'm eager to help move this forward 🚀 Looking forward to hearing your thoughts! Once again, thank you for this contribution! |
Thank you so very much for getting back to me and spending the time to look into this. I will start looking into each one of these suggestions and hopefully create some commits soon. |
Create basic language implementation. Start adding tests. Add snapshot tests Update slice type to map to IEnumerable instead of Array. Drop support for Unit type and return an error. Support anonymous structs Update slice of user type test snapshot Support namespace option Support serialization with json attributes Remove EnumLabel and use EnumMember attribute instead. Update all test snapshots according to the new changes. C# without naming convention option Add required attribute For newtonsoft json to require a non optional property, the property has to have the required attribute. Otherwise, it allows it to be null and a default value is provided.
f45e2a6
to
4177c84
Compare
The order of elements in the output file has been updated
Re add CSharp imports and update configuration and Args handling
Overview
Add support for C# version 11 with NewtonsoftJson as/serialization/deserialization library.
Important Notes
Unit
type, and hence, it results in an error when the target language is C#Testing
I've added snapshot tests to most cases except when the Unit type or Aliases are needed, as this is not supported in C#.