intility / intility/json-api-toolkit
Use DI parser in AllowedIncludesAttribute
Open
@erlendellefsen is already working on this.
Since Aug 20, 2026.
.NET
bug
- Dominant language
- C#
- Stars
- 7
- Forks
- 0
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 23
Description
AllowedIncludesAttribute.OnActionExecuting (line 64) calls JsonApiQueryParser.Parse directly, bypassing the QueryComplexityAnalyzer.Validate step that runs in IJsonApiQueryParser. Two issues:
- Filter limits (count, depth, value length) are not enforced for actions decorated with
[AllowedIncludes]. - The same request is parsed twice (once in the attribute, once in the controller).
Acceptance criteria
- Attribute resolves
IJsonApiQueryParserfromcontext.HttpContext.RequestServices - Parsed
QueryParametersis stashed (e.g. onHttpContext.Items) and reused by the controller - New test: a request with a filter tree exceeding
JsonApiOptions.MaxFiltersreturns 400 on a[AllowedIncludes]action - Existing
[AllowedIncludes]integration tests still pass
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.