-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException when POST is invoked for the field with custom logic in getter #3328
Comments
Shouldn't your |
Actually no, the |
Elide can update relationships in a separate step from the main entity. |
Yes, I understand that. But adding a null check to the getter logic is a bit confusing given the value is required. |
Not sure what you are expecting Elide to do since this is your own code. |
It seems to be pretty trivial situation to have a custom logic in getter when the value depends on multiple fields.
Maybe some mechanism to point out that this computed value depends on other fields or special handling for fields that have annotated getters would be useful in this particular case. P.S. I am new to Elide and currently only getting familiar with the framework by migrating from another JSON:API framework (CRNK) |
|
Sorry for the late response and thank you for the explanation. |
Don't think there is such a mechanism. |
Hello,
I am getting
NullPointerException
when invoking resource creation for JSON:API for the following scenario:TestEntity
in gist below) with the fieldstringValue
getStringValue
method that relies on another field (relatedValue
) which is another entity@ComputedAttribute
. Otherwise, getter logic is ignored and a raw value from the field is returned.There is a
DemoApplicationTests
that covers GET/POST/PATCH requests and currentlytestCreate
fails with the exception:Please advise if I have a misconfiguration or how the issue could be fixed.
Gist with a demo application: https://gist.github.com/tory-kk/5db5dfd5b073446b1bfa680ddd0cf63f
Elide version: 7.1.4
The text was updated successfully, but these errors were encountered: