Title: [v11] Sparse fieldsets allow for invalid types · Issue #1460 · JSONAPI-Resources/jsonapi-resources · GitHub
Open Graph Title: [v11] Sparse fieldsets allow for invalid types · Issue #1460 · JSONAPI-Resources/jsonapi-resources
X Title: [v11] Sparse fieldsets allow for invalid types · Issue #1460 · JSONAPI-Resources/jsonapi-resources
Description: This issue is a (choose one): Problem/bug report. Feature request. Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead. Checklist before submitting: I've searched for an existing issu...
Open Graph Description: This issue is a (choose one): Problem/bug report. Feature request. Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead. Checklist before submit...
X Description: This issue is a (choose one): Problem/bug report. Feature request. Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead. Checklist before submit...
Opengraph URL: https://github.com/JSONAPI-Resources/jsonapi-resources/issues/1460
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[v11] Sparse fieldsets allow for invalid types","articleBody":"## This issue is a (choose one):\r\n\r\n- [x] Problem/bug report.\r\n- [ ] Feature request.\r\n- [ ] Request for support. **Note: Please try to avoid submitting issues for support requests. Use [Gitter](https://gitter.im/cerebris/jsonapi-resources) instead.** \r\n\r\n## Checklist before submitting:\r\n\r\n- [x] I've searched for an existing issue.\r\n- [ ] I've asked my question on [Gitter](https://gitter.im/cerebris/jsonapi-resources) and have not received a satisfactory answer.\r\n- [ ] I've included a complete [bug report template](https://github.com/cerebris/jsonapi-resources/blob/master/lib/bug_report_templates/rails_5_master.rb). This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.\r\n- [ ] The feature I'm asking for is compliant with the [JSON:API](http://jsonapi.org/) spec.\r\n\r\n## Description\r\n\r\nWhen specifying sparse fieldsets, if you specify the type as the singular version of the type (i.e. `fields[user]=name` instead of `fields[users]=name`, the request succeeds instead of returning a 400.\r\n\r\n### Bug reports:\r\n\r\nOn the `v0-11-dev` branch with Ruby 3.3.5. The root of the issue is that `classify` is used to look up the resource class, which works the same for `user` and `users`, they both become `UserResource`, but then `parse_fields` doesn't verify that the type matches after getting the resource class back. ","author":{"url":"https://github.com/adamkiczula","@type":"Person","name":"adamkiczula"},"datePublished":"2024-11-15T00:28:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1460/jsonapi-resources/issues/1460"}
| 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:e456eafe-cd08-ec3a-ed41-55948a401a6f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D94A:3EE845:2EC8367:400DB96:6A4EFC1D |
| html-safe-nonce | 179945099b78da1b679603bc3c1f53a374343865dff3dd5b06e846072593d3fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTRBOjNFRTg0NToyRUM4MzY3OjQwMERCOTY6NkE0RUZDMUQiLCJ2aXNpdG9yX2lkIjoiNTI2NDgwMzQxNzUzMjg1NzM3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5b9fd6bd956b178c54d916df957139cc3c92995ac41a3cba80d58f5f7a41d5ff |
| hovercard-subject-tag | issue:2660419477 |
| 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/JSONAPI-Resources/jsonapi-resources/1460/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dfffcb63815a567d85b97e14d65faeafbe8a897a9e7d1ec7dea74b25e24077f9/JSONAPI-Resources/jsonapi-resources/issues/1460 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dfffcb63815a567d85b97e14d65faeafbe8a897a9e7d1ec7dea74b25e24077f9/JSONAPI-Resources/jsonapi-resources/issues/1460 |
| og:image:alt | This issue is a (choose one): Problem/bug report. Feature request. Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead. Checklist before submit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adamkiczula |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/JSONAPI-Resources/jsonapi-resources git https://github.com/JSONAPI-Resources/jsonapi-resources.git |
| octolytics-dimension-user_id | 262422067 |
| octolytics-dimension-user_login | JSONAPI-Resources |
| octolytics-dimension-repository_id | 18248068 |
| octolytics-dimension-repository_nwo | JSONAPI-Resources/jsonapi-resources |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 18248068 |
| octolytics-dimension-repository_network_root_nwo | JSONAPI-Resources/jsonapi-resources |
| 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 | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width