Title: Support additionnalProperties: false in OneOf · Issue #668 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: Support additionnalProperties: false in OneOf · Issue #668 · oapi-codegen/oapi-codegen
X Title: Support additionnalProperties: false in OneOf · Issue #668 · oapi-codegen/oapi-codegen
Description: If I have an openApi schema that has additionalProperties: false, and I send a request with extra fields, it should be refused.. After more research, I found out this is the job of the request validator. But It doesn't change what happen...
Open Graph Description: If I have an openApi schema that has additionalProperties: false, and I send a request with extra fields, it should be refused.. After more research, I found out this is the job of the request vali...
X Description: If I have an openApi schema that has additionalProperties: false, and I send a request with extra fields, it should be refused.. After more research, I found out this is the job of the request vali...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/668
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support additionnalProperties: false in OneOf","articleBody":" ~~If I have an openApi schema that has additionalProperties: false, and I send a request with extra fields, it should be refused.~~. \r\n\r\nAfter more research, I found out this is the job of the request validator. But It doesn't change what happens about OneOf.\r\n\r\nFor methods like AsSomeType() generated in case of a OneOf\r\n\r\nIs currently deserialized like this :\r\n```go\r\n var body MyElement\r\n\terr := json.Unmarshal(t.union, &body)\r\n\treturn body, err\r\n```\r\n\r\nAnd it should be deserialized like this (if the target schema has additionalProperties set to false) : \r\n```go\r\n var body MyElement\r\n\r\n\tdec := json.NewDecoder(bytes.NewReader(t.union))\r\n\tdec.DisallowUnknownFields()\r\n\terr := dec.Decode(&body)\r\n\t\r\n\treturn body, err\r\n```","author":{"url":"https://github.com/LelouBil","@type":"Person","name":"LelouBil"},"datePublished":"2022-07-07T14:01:43Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/668"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:3bd14e58-1339-529d-53f0-ccbcc36c9587 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 987C:F70D2:26368E:352720:6AF9C9C8 |
| html-safe-nonce | 4f88d75597f51d2b5ac20aff4fec0cbfbbc2e23449cbb7d1ea8e0a6960ec355b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODdDOkY3MEQyOjI2MzY4RTozNTI3MjA6NkFGOUM5QzgiLCJ2aXNpdG9yX2lkIjoiNzY4MzU4OTczODYzMTY0NTY0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 15f58ee1642567e74cc6028829481c097c452455e36613ca6dc616deee7a6760 |
| hovercard-subject-tag | issue:1297500245 |
| 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/oapi-codegen/oapi-codegen/668/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17a108158f4b0207b4539e283a26b8057019233aef9604fad4948336bb4f54ba/oapi-codegen/oapi-codegen/issues/668 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17a108158f4b0207b4539e283a26b8057019233aef9604fad4948336bb4f54ba/oapi-codegen/oapi-codegen/issues/668 |
| og:image:alt | If I have an openApi schema that has additionalProperties: false, and I send a request with extra fields, it should be refused.. After more research, I found out this is the job of the request vali... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LelouBil |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/oapi-codegen/oapi-codegen git https://github.com/oapi-codegen/oapi-codegen.git |
| octolytics-dimension-user_id | 142752710 |
| octolytics-dimension-user_login | oapi-codegen |
| octolytics-dimension-repository_id | 173009358 |
| octolytics-dimension-repository_nwo | oapi-codegen/oapi-codegen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 173009358 |
| octolytics-dimension-repository_network_root_nwo | oapi-codegen/oapi-codegen |
| 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 | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width