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
A custom policy in the user's code is implemented by extending the io.spine.server.event.Policy class and overriding the whenever() method. The user also should not forget to add the @React annotation to the method. Otherwise, the method won't be picked up for building routing schemas.
The last step is:
Often forgotten, especially by new users. It takes long minutes of debugging to find out the frustrating fact of the missing the annotation.
Does not look natural because we have the abstract base class and require implementing the method. Both are known to the framework.
The abstract method whenever() already has the annotation @ContractFor(handler = React::class) which nicely explains the matter, and links it semantically with the routing annotation @React.
Let's make the framework to take into account all classes descending from Policy and include their whenever() methods even if they do not have the @React annotation.
The text was updated successfully, but these errors were encountered:
A custom policy in the user's code is implemented by extending the
io.spine.server.event.Policy
class and overriding thewhenever()
method. The user also should not forget to add the@React
annotation to the method. Otherwise, the method won't be picked up for building routing schemas.The last step is:
The abstract method
whenever()
already has the annotation@ContractFor(handler = React::class)
which nicely explains the matter, and links it semantically with the routing annotation@React
.Let's make the framework to take into account all classes descending from
Policy
and include theirwhenever()
methods even if they do not have the@React
annotation.The text was updated successfully, but these errors were encountered: