-
Notifications
You must be signed in to change notification settings - Fork 55
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
Properties in different classes inheriting same base classes #22
Comments
Hello, regards |
Can you please provide a minimal example (just the classes you would like to use) so that it fails? |
sorry, |
Glad you fixed it. Yes, it's annoying to initialize all properties, but it's necessary. |
Hi, I have the same problem even with properties initialized. My classes
My test exemple
The error I get
You can see I have 2 children with attribute _value. But when I try to deserialize, json2typeScript try to convert my string in number for TestString. Thank you in advance for your answer. |
As mentioned in the first post, this issue is to be expected. Right now, it is not possible to use the same property name with class inheritance. There is an easy workaround though: No one (except you) will care about the name of the private property. You will be exposing only the public getter/setter. Just rename the I will fix this issue in the next release, of course. |
@Sooulm8 the current version (1.0.3) fixes this problem. There is only one case I couldn't properly "fix". If you consider your example, it is important that if you write the decorator That means: Your example should work exactly like you posted it, but it will fail if you remove the decorator from one but not both |
I should look into the following issue:
If two classes inherit from the same base class and use different mappings for the same property name, there will be a conflict in json2typescript.
The text was updated successfully, but these errors were encountered: