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
Java validation won't work with readOnly and writeOnly properties as they will all get validated every time. We can use javax.validation groups in order to apply our validation rules to explicit groups... see https://www.baeldung.com/javax-validation-groups
If we try to introduce @javax.annotations.Nonnull annotations we will still have issues... maybe solved as for TypeScript
TypeScript has interfaces, and we add readonly annotations to our readOnly properties. However if a readOnly property is required then we need to set it when we make a new object conforming to the interface, but we don't want to, because we're not going to send it!
Maybe we can make some support interfaces and functions to help with this...
So we get a type (XRequest) that represents everything that isn't readOnly and a function to turn that type into the original so we can use it everywhere.
Maybe these sorts of functions would be useful anyway for creating new instances of interfaces that have discriminators, so you don't have to set the discriminator yourself!
The text was updated successfully, but these errors were encountered:
Java validation won't work with
readOnly
andwriteOnly
properties as they will all get validated every time. We can usejavax.validation
groups in order to apply our validation rules to explicit groups... see https://www.baeldung.com/javax-validation-groupsIf we try to introduce
@javax.annotations.Nonnull
annotations we will still have issues... maybe solved as for TypeScriptTypeScript has interfaces, and we add
readonly
annotations to ourreadOnly
properties. However if areadOnly
property isrequired
then we need to set it when we make a new object conforming to the interface, but we don't want to, because we're not going to send it!Maybe we can make some support interfaces and functions to help with this...
So we get a type (XRequest) that represents everything that isn't
readOnly
and a function to turn that type into the original so we can use it everywhere.We then also need the explicit JSON serialisation from https://github.com/karlvr/openapi-generator-plus-express-passport so that we only serialize what we should.
Maybe these sorts of functions would be useful anyway for creating new instances of interfaces that have discriminators, so you don't have to set the discriminator yourself!
The text was updated successfully, but these errors were encountered: