Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dredd is ignoring default value for enum type parameter and failing validation #872

Closed
karpilin opened this issue Aug 21, 2017 · 8 comments · Fixed by #874
Closed

dredd is ignoring default value for enum type parameter and failing validation #872

karpilin opened this issue Aug 21, 2017 · 8 comments · Fixed by #874
Labels

Comments

@karpilin
Copy link

Describe your problem

Dredd is failing API Blueprint validation if there is an enum type parameter on the endpoint. Default value is ignored. Apiary validation is working fine.

for example:

# Group Example
## Endpoint [GET /example{?type}]

+ Parameters
    + type: `foo` (enum[string], optional)
        + Members
            + `foo`
            + `bar`

+ Response 200 (application/json)
    + Attributes
        + data: `some string` (string, required)

throwing out the following error:

error: Compilation error in file 'example.apib': URI parameter 'type' example value is not one of enum values. (Example > Endpoint > Endpoint)

What's your dredd --version output?

dredd v4.3.0 (Darwin 16.7.0; x64)
@honzajavorek
Copy link
Contributor

Hi @karpilin! Thanks for the report. This looks like a bug. Is this something what worked in previous Dredd versions?

@karpilin
Copy link
Author

I think it did, but then I tried to rollback to previous versions all the way to 4.1.0, and dredd-transactions down to 4.2.0. but still was getting this error.

So the tests, that I believe were previously working, are failing now.

@honzajavorek
Copy link
Contributor

Thanks! I'll look into it.

@honzajavorek
Copy link
Contributor

I was able to reproduce this. Working on tests and fixes in apiaryio/dredd-transactions#98.

@iamharish
Copy link

iamharish commented Aug 21, 2017

Thanks @honzajavorek for looking into it. I'm using v.3.4.5. These tests were working earlier but started failing after I did an npm install while trying to fix some other issue. Surprised to see an old version getting affected by a recent change. Is there a version we can use while the fix is getting ready?

@mousavian
Copy link

mousavian commented Aug 22, 2017

We're affected by this as well.

Seems fury-adapter-swagger has introduced a breaking change while bumping version from 0.12.1 to 0.13.0, then it propagate with apiaryio/dredd-transactions@ea91dc6 PR which i guess is wrongly bumped with a patch version only (from 4.3.0 to 4.3.1)
and since it satisfies the semversion specified in package.json
hence all new dredd installations, even with restrict version are affected.

A quick solution to fix this, is using npm shrinkwrap or package-lock.json

@honzajavorek
Copy link
Contributor

I'm sorry for the regression. apiaryio/dredd-transactions#98 should soon fix the problem and since it's going to result in another patch version, the fix should automatically spread the same way as the problem did.

@mousavian
Copy link

Cool @honzajavorek , thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants