dredd
dredd copied to clipboard
An error occurs if "example value" is false and "required"
for more information https://github.com/apiaryio/dredd/issues/677#issuecomment-265946791
I think that we should change this conditional statement as follows.
https://github.com/apiaryio/dredd-transactions/blob/5b7f09f1777797451098864257175869e5f6b43e/src/validate-parameters.coffee#L6 before
if param.required and not param.example and not param.default
after
if param.required and not param.example and not param.default and typeof param.example isnt 'boolean'
https://github.com/apiaryio/dredd-transactions/blob/5b7f09f1777797451098864257175869e5f6b43e/src/expand-uri-template-with-parameters.coffee#L44 before
if param.example
after
if param.example or typeof param.example is 'boolean'
Are there better ideas? If there is no problem I will write a test and send a pull request.
Thanks! I think this problem has the same root as what we're discussing in https://github.com/apiaryio/dredd/issues/677#issuecomment-280013517.