Skip to content

Vaadin 24: has method annotated with ClientCallable whose return type is Object #12

@javier-godoy

Description

@javier-godoy

Describe the bug

My idea was to migrate a client callable method that returns JsonValue as:

@ClientCallable 
-JsonValue method() { 
+Object method() { 
  JsonValue result = ...;
- return result;
- return JsonMigration.convertToClientCallableResult(result);
}

(where convertToClientCallableResult would return an elemental JsonValue in Vaadin 24, and a Jackson node in Vaadin 25, hence convertToClientCallableResult returns Object)

However, Vaadin 24 inspects the client callable method and rejects it if the return type is not assignable to JsonValue. In other words, it does not like that the method returns Object.

Constraints:

  • In Vaadin 24: The method must return JsonValue
  • In Vaadin 25: The method must return an object that can be serialized with Jackson.

Expected behavior

The application must start.

Minimal reproducible example

Migrate a Vaadin 24 application that contains a @ClientCallable JsonValue method() as explained above.

Add-on Version

0.0.1-SNAPSHOT

Vaadin Version

25.0.0-beta5

Additional information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions