Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
RAGFlow workspace code commit ID
x
RAGFlow image version
cb1febb7d8ae (infiniflow/ragflow:v0.17.0-slim)
Other environment information
Actual behavior
The API accepts and persists invalid values for parser_config.chunk_token_count during dataset creation, including negative numbers, non-integer types, and out-of-range values.
Expected behavior
The API should reject requests with:
Negative integers (e.g., -1)
Non-integer types (e.g., 3.14, "1024")
Values exceeding reasonable limits (e.g., >2048)
Steps to reproduce
1. Send a POST request with invalid chunk_token_count values (e.g., -1, 3.14, "1024")
response = requests.post(
f'http://127.0.0.1:9380/api/v1/datasets',
json={
"name": "test",
"chunk_method": "naive",
"parser_config": {"chunk_token_count": -1} # Test with -1/3.14/"1024"
}
)
2. Observe the successful response:
{
"code": 0,
"data": {
"parser_config": {"chunk_token_count": -1},
"name": "test",
// ...other fields
}
}
Additional information
No response
Activity
asiroliu commentedon Mar 6, 2025
Currently, all parameters under parser_config lack type checking and validation of valid values.
Fix: add the validation for parser_config. (#5755)
Fix: add the validation for parser_config. (infiniflow#5755)
asiroliu commentedon Mar 10, 2025
{'code': 100, 'data': None, 'message': 'TypeError("\'<=\' not supported between instances of \'int\' and \'str\'")'}
Fix: add the validation for parser_config. (infiniflow#5755)
Fix: infiniflow#5719 Added type check for parser_config
3 remaining items