Describe the bug
It seems like the enforcement of the readOnly flag has changed during validation. In the past, it was not enforced that the request does not contain a field marked with readOnly, but now we get the following error:
{"message":"Error validating request: request body has an error: doesn't match schema #/components/schemas/Profile: readOnly property \"id\" in request","status":"bad-request"}
This breaks the backwards compatibility of the Core with old clients that were sending requests with these readOnly fields which were previously being ignored.
To Reproduce
Steps to reproduce the behavior:
Send request to PUT /services/account/profile with id field set
See validation error above.
Expected behavior
If a readOnly field is sent in a request, it should simply be ignored and discareded rather than failing the whole request. It seems like we can achieve this by setting the ExcludeReadOnlyValidations flag in the openapi3filter.Options in web/adapter.go:validateRequest.
Describe the bug It seems like the enforcement of the
readOnly
flag has changed during validation. In the past, it was not enforced that the request does not contain a field marked withreadOnly
, but now we get the following error:This breaks the backwards compatibility of the Core with old clients that were sending requests with these
readOnly
fields which were previously being ignored.To Reproduce Steps to reproduce the behavior:
PUT /services/account/profile
withid
field setExpected behavior If a
readOnly
field is sent in a request, it should simply be ignored and discareded rather than failing the whole request. It seems like we can achieve this by setting theExcludeReadOnlyValidations
flag in theopenapi3filter.Options
inweb/adapter.go:validateRequest
.