vaadin-connect icon indicating copy to clipboard operation
vaadin-connect copied to clipboard

Define how TS types are generated for Java types with `@JsonIgnore` and other Jackson annotations

Open vlukashov opened this issue 6 years ago • 1 comments
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.

vlukashov avatar Mar 28 '19 07:03 vlukashov

@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 use foo as the property name instead of the original name
  • @JsonIgnoreProperties on the class has the same effect as @JsonIgnore on an individual property.
  • @JsonTypeInfo which 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 as any in TS whenever that annotation is present?).
  • @JsonAutoDetect which affects which properties are actually considered.

Legioth avatar Mar 28 '19 08:03 Legioth