Title: Multi-query parameter validation not working · Issue #366 · python-openapi/openapi-core · GitHub
Open Graph Title: Multi-query parameter validation not working · Issue #366 · python-openapi/openapi-core
X Title: Multi-query parameter validation not working · Issue #366 · python-openapi/openapi-core
Description: Validation for query parameter with multiple values (i.e. array values in form-style query expansion) not working, at least from version 0.13.3 of openapi-core. Example request: http://localhost:8000/v1/test?a=1&a=2 Appropriate OpenAPI s...
Open Graph Description: Validation for query parameter with multiple values (i.e. array values in form-style query expansion) not working, at least from version 0.13.3 of openapi-core. Example request: http://localhost:80...
X Description: Validation for query parameter with multiple values (i.e. array values in form-style query expansion) not working, at least from version 0.13.3 of openapi-core. Example request: http://localhost:80...
Opengraph URL: https://github.com/python-openapi/openapi-core/issues/366
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Multi-query parameter validation not working","articleBody":"Validation for query parameter with multiple values (i.e. array values in form-style query expansion) not working, at least from version `0.13.3` of `openapi-core`.\r\n\r\nExample request:\r\n```\r\nhttp://localhost:8000/v1/test?a=1\u0026a=2\r\n```\r\n\r\nAppropriate OpenAPI spec to validate above parameters as `a = ['1', '2']`:\r\n```\r\nparameters:\r\n - in: query\r\n name: a\r\n description: Test query parameter.\r\n schema:\r\n type: array\r\n items:\r\n type: string\r\n required: true\r\n```\r\n\r\nValidation error:\r\n```\r\nopenapi_core.unmarshalling.schemas.exceptions.InvalidSchemaValue: Value [['1', '2']] not valid for schema of type array: (\u003cValidationError: \"['1', '2'] is not of type string\"\u003e,)\r\n```\r\n\r\nTill version `0.13.8` it was possible to \"cheat\" validation by describing schema as:\r\n```\r\nparameters:\r\n - in: query\r\n name: a\r\n description: Test query parameter.\r\n schema: {}\r\n required: true\r\n```\r\n\r\nUnfortunately, above workaround not working anymore (from version `0.14.0`), but strangely, schema can be described as follows:\r\n```\r\nparameters:\r\n - in: query\r\n name: a\r\n description: Test query parameter.\r\n schema:\r\n type: array\r\n items:\r\n type: array\r\n items:\r\n type: string\r\n required: true\r\n```\r\n\r\nHowever, this is not proper way to describe query parameter with multiple values and should be fixed!","author":{"url":"https://github.com/stojan-jovic","@type":"Person","name":"stojan-jovic"},"datePublished":"2021-06-27T01:46:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/366/openapi-core/issues/366"}
| 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:bd0e1cb1-a1f3-072a-00be-819124f757fd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E882:E936C:8C0F7:C20CD:6977802C |
| html-safe-nonce | ccf1554f5cd4c3834819286b7dbf00a5ae00bcca17e04b89cef96b3a91d652cb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODgyOkU5MzZDOjhDMEY3OkMyMENEOjY5Nzc4MDJDIiwidmlzaXRvcl9pZCI6IjQ2NDk5NTAyMjYxNzkzNTkxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fbb79fa066e8f18246f4ff9241cbe9b6234c211006c1a8751e27555205874236 |
| hovercard-subject-tag | issue:930828661 |
| 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/366/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64c5c34c67c83abd6264df15a711532debbf4c6b79fb0f493b377aaca95bbdda/python-openapi/openapi-core/issues/366 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64c5c34c67c83abd6264df15a711532debbf4c6b79fb0f493b377aaca95bbdda/python-openapi/openapi-core/issues/366 |
| og:image:alt | Validation for query parameter with multiple values (i.e. array values in form-style query expansion) not working, at least from version 0.13.3 of openapi-core. Example request: http://localhost:80... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stojan-jovic |
| hostname | github.com |
| expected-hostname | github.com |
| None | fd37f8e74ecc49b700617ea694fa6d7b395b6c9a4b79c59b3014da220462ac69 |
| 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 | 37dddf0637fe1f68f5c5d619bd3e03ec27105339 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width