-
-
Notifications
You must be signed in to change notification settings - Fork 135
Include parameter name in JSON Schema error path on unmarshalling #246
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
Similar issue with It doesn't contain |
Yeah this is a must |
By the way, do you know how to determine the location (path, body, header, etc.) where the erroring parameter is located? It's not in the error object, either. |
I feel this is resolved please see my answer to #241 |
I don't think this is resolved. I need to differentiate between schema errors in the request body and in the request parameters (e.g. query string) and there seems to be no info about this on the exception intself nor the schema errors it contains. |
I don't know the code base too well, but I was poking around. Couldn't the parameter name just be mapped to the exception here? try:
value = self._get_parameter(param, request)
except MissingParameter:
continue
except (
MissingRequiredParameter,
DeserializeError,
CastError,
ValidateError,
UnmarshalError,
) as exc:
errors.append(exc)
continue
else:
location = getattr(parameters, param_location)
location[param_name] = value |
Errors are definitely something to improve. However this will be a breaking change and I was waiting for this until I refactor validators. I will add errors refactor to the 0.17 roadmap. |
Hi,
I've run into the problem, when I'm not able to show which invalid parameter raised an
InvalidSchemaValue
.As
InvalidSchemaValue
contains a list ofschema_errors
(List[JsonSchemaValidationError]
) I expect to haverelative_path
/absoulte_path
filled for its items. But in reality all items have emptypath
/relative_path
attributes (andabsolute_path
property).I've managed to fix this by manually add parameter name as JSON Schem error path as,
instead of plain,
But would like to have path filled by
openapi_core
instead.More details in playpauseandstop/rororo#53
The text was updated successfully, but these errors were encountered: