Title: Include parameter name in JSON Schema error path on unmarshalling · Issue #246 · python-openapi/openapi-core · GitHub
Open Graph Title: Include parameter name in JSON Schema error path on unmarshalling · Issue #246 · python-openapi/openapi-core
X Title: Include parameter name in JSON Schema error path on unmarshalling · Issue #246 · python-openapi/openapi-core
Description: 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 of schema_errors (List[JsonSchemaValidationError]) I expect to have relative_path / abso...
Open Graph Description: 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 of schema_errors (List[JsonSchemaValidationError...
X Description: 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 of schema_errors (List[JsonSchemaValidat...
Opengraph URL: https://github.com/python-openapi/openapi-core/issues/246
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Include parameter name in JSON Schema error path on unmarshalling","articleBody":"Hi,\r\n\r\nI've run into the problem, when I'm not able to show which invalid parameter raised an `InvalidSchemaValue`.\r\n\r\nAs `InvalidSchemaValue` contains a list of `schema_errors` (`List[JsonSchemaValidationError]`) I expect to have `relative_path` / `absoulte_path` filled for its items. But in reality all items have empty `path` / `relative_path` attributes (and `absolute_path` property).\r\n\r\nI've managed to fix this by manually add parameter name as JSON Schem error path as,\r\n\r\n```python\r\n try:\r\n return unmarshaller(value)\r\n except InvalidSchemaValue as err:\r\n # Modify invalid schema validation errors to include parameter name\r\n if isinstance(param_or_media_type, Parameter):\r\n param_name = param_or_media_type.name\r\n\r\n for schema_error in err.schema_errors:\r\n schema_error.path = schema_error.relative_path = deque(\r\n [param_name]\r\n )\r\n\r\n raise err\r\n```\r\n\r\ninstead of plain,\r\n\r\n```python\r\n return unmarshaller(value)\r\n```\r\n\r\nBut would like to have path filled by `openapi_core` instead.\r\n\r\n----\r\n\r\nMore details in https://github.com/playpauseandstop/rororo/pull/53\r\n","author":{"url":"https://github.com/playpauseandstop","@type":"Person","name":"playpauseandstop"},"datePublished":"2020-04-23T14:27:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/246/openapi-core/issues/246"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4120f7ba-6b06-bff7-a00a-274e9a40f755 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C78E:162063:32C8BC4:4641B9D:6977C78A |
| html-safe-nonce | df7424d562166437ad9de8a7c7457326059eabd17fb5eab1d5b7d6c0f5976241 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzhFOjE2MjA2MzozMkM4QkM0OjQ2NDFCOUQ6Njk3N0M3OEEiLCJ2aXNpdG9yX2lkIjoiMjUyMDMxOTY3MTg1NzAzOTI0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 393a031ef74ba9af3a1ef109141d1286c40e09cde3f75193840fa871f627b067 |
| hovercard-subject-tag | issue:605585376 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openapi/openapi-core/246/issue_layout |
| twitter:image | https://opengraph.githubassets.com/696275cc8530bc266e7015efd838cff442a3bea8fb197c7bcac7b77cfc44ac59/python-openapi/openapi-core/issues/246 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/696275cc8530bc266e7015efd838cff442a3bea8fb197c7bcac7b77cfc44ac59/python-openapi/openapi-core/issues/246 |
| og:image:alt | 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 of schema_errors (List[JsonSchemaValidationError... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | playpauseandstop |
| hostname | github.com |
| expected-hostname | github.com |
| None | dd7783bd9901db88bac6bc215af7f020bc205a04ebc67e6c7def882ef2859ecd |
| turbo-cache-control | no-preview |
| go-import | github.com/python-openapi/openapi-core git https://github.com/python-openapi/openapi-core.git |
| octolytics-dimension-user_id | 126442889 |
| octolytics-dimension-user_login | python-openapi |
| octolytics-dimension-repository_id | 104200746 |
| octolytics-dimension-repository_nwo | python-openapi/openapi-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 104200746 |
| octolytics-dimension-repository_network_root_nwo | python-openapi/openapi-core |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5d30081a77a5d66860584073cb38fd98fd7f9388 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width