Making Read-Only Fields Truly Read-Only #876
davidpryor
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
Read only fields are a think we had to deal with a few times in the past C.f. #291 The first thing here is to find out which fields are the read only ones and then we can think about who to mark this |
Beta Was this translation helpful? Give feedback.
1 reply
-
@davidpryor @M123-dev My 2 cents:
My suggestion:
And the "usual suspects":
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I wanted to gauge the interest in removing the setters for read-only fields. This will protect users from believing a field is used to set some value on the backend.
My thoughts on achieving this is simply moving the current json deserialization to point to a private attribute and exposing this attribute through a getter (basically just removing the setter for the read-only fields).
EXAMPLE: Product class
Before:
After:
I know this particular field is one a user may not think about settings, but if we look at
brandsTags
- which I believe may be read-only but may be mistaken - a user could believe this is a method of sending their brands in a List instead of a csv String inbrands
Just wanted to get some thoughts on this 😁
Beta Was this translation helpful? Give feedback.
All reactions