-
Notifications
You must be signed in to change notification settings - Fork 21
readOnly: true forbid re-use of ref in valid context #74
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
Comments
Hi, this is incorrect usage of readOnly, see docs
You can use it only in |
Fair enough, stack overflow then advices to combine with allOf which will lead to the other issue I reported earlier :D |
Btw, found more information about his: If I understand correctly it's kinda a grey area but it seems to be common to just ignore this property when seen outside applicable context. |
I thought it will be hard to implement, but with the addition of a pinch of crutches, it is actually possible :) |
Thanks :) |
Hello again,
If I define a model for ObjectId which is marked as readOnly: true I can use it properly in GET and POST route (and thanks a lot for that !) sadly I cannot re-use this model in /get/{id} route (validation fails).
Here is a complete example showing the issue (actually most of the code is useless, all you need is to call /get/12345 and see the validation error:
Regards, Adam.
The text was updated successfully, but these errors were encountered: