Title: [Bug]: Boolean type is not strict · Issue #998 · python-openapi/openapi-core · GitHub
Open Graph Title: [Bug]: Boolean type is not strict · Issue #998 · python-openapi/openapi-core
X Title: [Bug]: Boolean type is not strict · Issue #998 · python-openapi/openapi-core
Description: Actual Behavior I have this in my api spec: "properties": { "active": { "type": "boolean" } } If in my request body I pass: { "active": "invalid" } I get a CastError. Expected Behavior If in my request body I pass: { "active": "invalid" ...
Open Graph Description: Actual Behavior I have this in my api spec: "properties": { "active": { "type": "boolean" } } If in my request body I pass: { "active": "invalid" } I get a CastError. Expected Behavior If in my req...
X Description: Actual Behavior I have this in my api spec: "properties": { "active": { "type": "boolean" } } If in my request body I pass: { "active": "inval...
Opengraph URL: https://github.com/python-openapi/openapi-core/issues/998
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Boolean type is not strict","articleBody":"### Actual Behavior\n\nI have this in my api spec:\n```json\n\"properties\": {\n\t\"active\": {\n\t\t\"type\": \"boolean\"\n\t}\n}\n```\nIf in my request body I pass:\n```json\n{\n\t\"active\": \"invalid\"\n}\n```\nI get a `CastError`.\n\n### Expected Behavior\n\nIf in my request body I pass:\n```json\n{\n\t\"active\": \"invalid\"\n}\n```\nI get an `InvalidSchemaValue` because the field `active` is not of type `boolean`.\n\n### Steps to Reproduce\n\nHave a field of type `boolean`. Pass a `invalid` string in the request body.\n\n### OpenAPI Core Version\n\n0.19.5\n\n### OpenAPI Core Integration\n\ndjango\n\n### Affected Area(s)\n\n_No response_\n\n### References\n\n_No response_\n\n### Anything else we need to know?\n\n_No response_\n\n### Would you like to implement a fix?\n\nNo","author":{"url":"https://github.com/afonsocraposo","@type":"Person","name":"afonsocraposo"},"datePublished":"2025-06-05T13:21:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/998/openapi-core/issues/998"}
| 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:92d656b3-0b30-8df0-328f-06f0a7ce540e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6D8:F16ED:10AAB96:172AEF1:6977AC5C |
| html-safe-nonce | 72ea8c6b34b11762a81bea4ae203ae54e2b79d6ba08e961d587027182203f4be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkQ4OkYxNkVEOjEwQUFCOTY6MTcyQUVGMTo2OTc3QUM1QyIsInZpc2l0b3JfaWQiOiIyMTY0ODExNDExODU3MzIxMDUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 206c1292e4f9fb41eed56fe3fddf206f7b6b5d7af2da3f29efa0860d199bfe54 |
| hovercard-subject-tag | issue:3121225609 |
| 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/998/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e50dbcbaf9c821ba6e5271678bd9ea1cedecad49f89446d54f521e96f1888bf6/python-openapi/openapi-core/issues/998 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e50dbcbaf9c821ba6e5271678bd9ea1cedecad49f89446d54f521e96f1888bf6/python-openapi/openapi-core/issues/998 |
| og:image:alt | Actual Behavior I have this in my api spec: "properties": { "active": { "type": "boolean" } } If in my request body I pass: { "active": "invalid" } I get a CastError. Expected Behavior If in my req... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | afonsocraposo |
| hostname | github.com |
| expected-hostname | github.com |
| None | e8b91803a5fc7ac066710509c57c636dab6ed4620bd9213b470a4617c79989c9 |
| 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 | 9b4562e3c5c60b38349a7d80ec8e160c11fe84b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width