You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way for me to avoid RefFieldExample inheriting from MyBase while Person continues to inherit from MyBase?
The reason I want this in my actual application the parent constructor needs to create things for the Person object, but the RefFieldExample object is really just properties/data/input and can't share the same constructor.
I thought about trying to work around this with a custom template and extra template data to indicate which properties should inherit and which should not, but I have not gotten that working and it does not feel like a good appoach.
Thanks
The text was updated successfully, but these errors were encountered:
I thought about trying to work around this with a custom template and extra template data to indicate which properties should inherit and which should not, but I have not gotten that working and it does not feel like a good approach.
Depending on what conditions distinguish the inheritance source from the non-inheritance source, the method I can show you now is to use the custom template you are talking about here.
If you only want to operate on specific data classes, I think you can handle that.
I would like to specify a base class, but not have it enabled on properties that are referenced, i.e. no base class on the properties classes.
I'm not sure if this is a usage question or not - I don't see support for this.
I am starting with JSON schema and generating data classes.
The JSON schema that I am working with contains referenced fields.
Here's an example - base on https://koxudaxi.github.io/datamodel-code-generator/jsonschema/.
refFieldExample
is the new part.Running this
Results in:
Is there a way for me to avoid
RefFieldExample
inheriting fromMyBase
whilePerson
continues to inherit fromMyBase
?The reason I want this in my actual application the parent constructor needs to create things for the
Person
object, but theRefFieldExample
object is really just properties/data/input and can't share the same constructor.I thought about trying to work around this with a custom template and extra template data to indicate which properties should inherit and which should not, but I have not gotten that working and it does not feel like a good appoach.
Thanks
The text was updated successfully, but these errors were encountered: