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
As mentioned in #254 , now that we are supporting both fields and properties for the purposes of schema comprehension, it is possible to create properties that act like 'calculated fields':
But the above code is not sufficient, because currently we require both getter and setter to be present (and public). So you have to add the fake setters that throw.
Is there a way to have it both ways somehow? We want to ensure that we'll be able to write to a property (in case when we use the underlying class as output), but we also want to allow read-only properties (in case when we use it as input).
@TomFinley , do you have a recommendation? I am leaning towards allowing getter-only (or private-setter) properties to live, but only for input classes. This means that SchemaDefinition / InternalSchemaDefinition should have some IsReadOnly tracking, and corresponding error/warning messages in case we attempt to generate a 'poke' method for a read-only property .
The text was updated successfully, but these errors were encountered:
Hi @Zruty0 seems like what you've suggested is good. Tracking and error if these read only properties (and fields!) acceptable for input with a copy to support the ref call seems good to me. We will want something like this for F# support for sure.
As mentioned in #254 , now that we are supporting both fields and properties for the purposes of schema comprehension, it is possible to create properties that act like 'calculated fields':
But the above code is not sufficient, because currently we require both getter and setter to be present (and public). So you have to add the fake setters that throw.
Is there a way to have it both ways somehow? We want to ensure that we'll be able to write to a property (in case when we use the underlying class as output), but we also want to allow read-only properties (in case when we use it as input).
@TomFinley , do you have a recommendation? I am leaning towards allowing getter-only (or private-setter) properties to live, but only for input classes. This means that
SchemaDefinition
/InternalSchemaDefinition
should have someIsReadOnly
tracking, and corresponding error/warning messages in case we attempt to generate a 'poke' method for a read-only property .The text was updated successfully, but these errors were encountered: