Open fessmage opened 3 years ago
Got the same issue for the description below using dredd v14.1.0 (Linux 5.10.102.1-microsoft-standard-WSL2; x64)
FORMAT: 1A
# Foo API
## Group Pagination
### Get paginate foos [GET /foos{?page%5Bnumber%5D}{&page%5Bsize%5D}]
+ Parameters
+ page%5Bnumber%5D: `1` (number, optional) - Number of the page.
+ Default: `1`
+ page%5Bsize%5D: `2` (number, optional) - Number of items in each page.
+ Default: `50`
Changed the description to:
FORMAT: 1A
# Foo API
## Group Pagination
### Get paginated foos [GET /foos{?page%5Bnumber%5D}{&page%5Bsize%5D}]
+ Parameters
+ page[number]: `1` (number, optional) - Number of the page.
+ Default: `1`
+ page[size]: `2` (number, optional) - Number of items in each page.
+ Default: `50`
The warning was still logged but the tests were able to run.
But then it as aglio
who was not happy with that change, even though the html file was properly generated 🤷🏼♂️
>> Line 7: parameter 'page[number]' is not found within the URI template '/foos{?page%5Bnumber%5D}{&page%5Bsize%5D}' for 'Get paginated foos' (warning code 8)
>> Context
...
>> Line 7: parameter 'page[size]' is not found within the URI template '/foos{?page%5Bnumber%5D}{&page%5Bsize%5D}' for 'Get paginated foos' (warning code 8)
>> Context
...
My bad the test success was pure luck. The parameters were missing in the query, just forgot to update the response body 🤦🏼♂️.
Looks like there was a "related" fix to allow dots on request parameters but it does not actually fix this bug.
The issue is affecting Open Api v3, on swagger 2.0 is working fine.
The openApi parser (@apielements/openapi3-parser) is encoding the parameter name, so the parameter is never found on the available parameters.
One solution could be changing the openapi3-parse to return the parameters as the openapi2 parser, this could have more implications I don't already know. Another solution is to decode the parameter names after getting the parsing result, maybe on this line
Describe the bug Skipped tests when using square brackets in get parameter name
To Reproduce docker image apiaryio/dredd:14.0.0
api blueprint:
Expected behavior Successful test run with output
What's your
dredd --version
output?