Dredd fails to run when using an openapi3 file that uses square brackets in the query parameter names. Other issues regarding this problem seem to be closed/fixes but the problem still exists.
dredd.yml
color: true
dry-run: null
hookfiles: null
language: nodejs
require: null
server: npm start
server-wait: 3
init: false
custom: {}
names: false
only: []
reporter: false
output: []
header: []
sorted: false
user: null
inline-errors: false
details: false
method: []
loglevel: warning
path: []
hooks-worker-timeout: 5000
hooks-worker-connect-timeout: 1500
hooks-worker-connect-retry: 500
hooks-worker-after-connect-wait: 100
hooks-worker-term-timeout: 5000
hooks-worker-term-retry: 500
hooks-worker-handler-host: 127.0.0.1
hooks-worker-handler-port: 61321
config: ./dredd.yml
blueprint: api.yaml
endpoint: 'http://127.0.0.1:3000'
openapi.yaml
openapi: 3.0.0
info:
version: "1.1.1"
title: API
description: 'TODO: Add a description'
paths:
'/test-cases':
get:
summary: Retrieve all test cases
tags:
- Test case
parameters:
- name: filter[testCycle]
in: query
required: false
example: 1
description: Filter by test cycle id. .
schema:
type: string
- name: filter[customField]
in: query
required: false
description: Filter by custom field.
example: 1
schema:
type: string
Error:
2019-04-17T14:28:05.382Z - error: Compilation error in '/api/docs/api.yaml': Failed to parse URI template: /test-cases{?filter[testCycle],filter[customField]}
Error: SyntaxError: Expected "(", "*", ",", ":", "}" or [a-zA-Z0-9_.%] but "[" found. API > /test-cases > Retrieve all test cases)
What's your dredd --version output?
dredd v9.0.4 (Linux 4.18.0-17-generic; x64)
I think the cause of this problem is because Dredd is running an older version of the OAS 3 parser and I believe once that's updated to fury-adapter-oas3-parser 0.7.4 this problem will go away. @honzajavorek mentioned to me that updating is blocked by some internal refactoring, I am not sure which issue is tracking that though.
:tada: This issue has been resolved in version 11.1.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I can confirm this issue has been fixed with version 11.1.0. Cheers!
So Dredd doesn't fail anymore on the original issue but now skips the tests that have square brackets in the query parameter name:
warn: API description URI template expansion warning in /api/spec.oai (API > /users > Get all the users > 200 > application/vnd.api+json): Ambiguous URI parameter in template: /users{?filter%5Bemail%5D}
Hmm, that sounds like what I described here https://github.com/apiaryio/dredd/issues/1256#issuecomment-468632610 but I thought that was fixed by https://github.com/apiaryio/dredd-transactions/pull/246
Most helpful comment
I can confirm this issue has been fixed with version 11.1.0. Cheers!