vaadin-connect
vaadin-connect copied to clipboard
Define how TS types are generated for Java types with `@JsonIgnore` and other Jackson annotations
trafficstars
Error: Message: 'Validation error in service 'UserEndpoint' method 'update'', additional details: '[{"parameterName":"password","message":"Object of type 'class org.vaadin.wizard.data.User' has invalid property 'password' with value 'null', validation error: 'must not be null'"}]'
Does not sound very reasonable when password is marked with @JsonIgnore.
@JsonIgnore is probably the most important annotation, but it would also be great if some other annotations would be taken into account:
@JsonProperty("foo")should cause the TS type to usefooas the property name instead of the original name@JsonIgnorePropertieson the class has the same effect as@JsonIgnoreon an individual property.@JsonTypeInfowhich is used for polymorphic types. Correctly dealing with this case would probably be quite complex, but we might want to add some warnings about the case for now (or define asanyin TS whenever that annotation is present?).@JsonAutoDetectwhich affects which properties are actually considered.