-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unknown validator exception for read_only when using requires/optional with Entity #2345
Comments
seems reasonable to me to add to the
|
Thank you for the direction to the relevant part of the docs. I appreciate the work you are doing with Grape. |
Hello Grape team,
I am using grape-entity objects for defining my endpoint's parameters, and I ran across this issue.
My entity exposes ID as a read only value, as our back end controls this value
When defining a PUT request that uses the entity documentation for defining the params it generates an error
I found #2338 which fixed a similar issue for other documentation keys, i.e.
is_array
, which have been using. I noticed in the PR @mscrivo mentions there maybe other keywords that belong inRESERVED_DOCUMENTATION_KEYWORDS
and I wonder if this is one of them?At first I thought it wasn't, but as a PUT request requires an ID to determine which record to update and our back end controls ID creation, then ID should be marked as read_only to inform users of the API that they cannot change or supply their own value.
If this thinking is correct, then I would be happy to create a PR to include
read_only
inRESERVED_DOCUMENTATION_KEYWORDS
. If not then I will re-evaluate my approach.The text was updated successfully, but these errors were encountered: