huma icon indicating copy to clipboard operation
huma copied to clipboard

Does readOnly actually do any validation?

Open jpincas opened this issue 1 month ago • 1 comments

Quick question. Using the readOnly tag. I can see that it effectively removes the field from the documentation for POST/PATCH requests, but it doesn't actually seem to have any validatory effect.

To be specific. My struct has a field daysOld which is marked 'readOnly'. Although the field doesn't show in the docs, I can add it to a PATCH request and no error is raised and the field is effectively written to the server.

My expectation was that adding the 'readOnly' field would mean that if the field were included in a PATCH request, either an error would be raised or it would just be ignored. Perhaps I've missed something here? Thanks.

jpincas avatar Jun 07 '24 10:06 jpincas