[Bug]: content-length-guardrail policy accepts a non-string streamingJsonPath at API creation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Find the content-length-guardrail policy schema and compare its response parameters with the documented streamingJsonPath string parameter and the word-count-guardrail example. Check the integration suite referenced in wso2/gateway-controllers#415 to understand the existing API creation behavior. Done when API creation rejects a non-string streamingJsonPath with HTTP 400, consistent with jsonPath.
Written by the indexing model from the issue text.
Description
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/Configuration (Config files, settings, env vars, defaults)
Description
The content-length-guardrail documentation lists streamingJsonPath as a string parameter of the response configuration. The policy reads it and refuses a value that is not a string. Its schema does not declare the parameter, so a wrong value passes API creation and fails at runtime instead.
The API is created, and every request to the operation then gets HTTP 500. A typo in this parameter breaks the operation instead of failing the deployment. jsonPath is declared as a string, and a non-string jsonPath is rejected at creation as expected.
The other seven policies in the repository that read streamingJsonPath all declare it in their schema, for example word-count-guardrail:
streamingJsonPath:
type: string
The integration suite in wso2/gateway-controllers#415 asserts the current behaviour.
Steps to Reproduce
- Create a REST API with an operation that attaches the policy with a non-string
streamingJsonPath:{"name":"content-length-guardrail","version":"v1","params":{"response":{"enabled":true,"min":1,"max":10,"streamingJsonPath":5}}} - The API is created.
- Every request to that operation gets HTTP 500. An operation on the same API with a valid configuration still works.
- Repeat with
"jsonPath": 5. API creation fails with HTTP 400, as expected.
Severity Level of the Issue
Severity/Minor (Non-critical functionality. Can be fixed in future releases)
Environment Details (with versions)
- Policy:
content-length-guardrailv1.1.0, wso2/gateway-controllers main (4f1520a8) - Gateway versions: 1.1.0 (patched), 1.2.0 and latest (
main-59dcd51)
- Dominant language
- Go
- Stars
- 85
- Forks
- 137
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 247
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing 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.
More from wso2/api-platform
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
wso2/api-platform#4369 ·
Maintainers usually reply within 1 day
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsOpenArea/Policies Aspect/Other Severity/Trivial Type/Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
wso2/api-platform#4355 ·
Maintainers usually reply within 1 day
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wso2/api-platform#4348 ·
Maintainers usually reply within 1 day
-
Aspect/AI Aspect/API. Severity/Major
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
wso2/api-platform#4343 ·
Maintainers usually reply within 1 day
-
Area/Policies Aspect/API Aspect/Configuration Severity/Minor Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
wso2/api-platform#4329 ·
Maintainers usually reply within 1 day
All issues in wso2/api-platform
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
keyxmakerx/Chronicle#2285 ·
Maintainers usually reply within 1 day
-
vLLM metrics adapter tests start the adapter twice and race on its request countersPossibly taken @bhargavchintam claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
llm-d/llm-d-inference-sim#933 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spellshift/realm#2509 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
lionsoul2014/ip2region#552 ·
Maintainers usually reply within 1 day