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

Add check for duplicate operation ids #92

Merged
merged 1 commit into from
Aug 24, 2018

Conversation

marcelstoer
Copy link
Contributor

Fixes #68

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 97.664% when pulling 4e6ed4b on marcelstoer:feat/dup-operationId into f8113cf on BigstickCarpet:master.

@marcelstoer
Copy link
Contributor Author

James, what is your plan with the 4.x branch? Shall I create another PR for this to get back-ported?

@marcelstoer
Copy link
Contributor Author

@BigstickCarpet any feedback yet?

@JamesMessinger
Copy link
Member

@marcelstoer - I somehow completely missed this PR, so thank you for pinging me on it. It looks great! Thanks for adding a test too 👍

@JamesMessinger JamesMessinger merged commit e58c457 into APIDevTools:master Aug 24, 2018
@JamesMessinger
Copy link
Member

whoops! The browser tests failed because Array.includes() isn't supported on older browsers. I'll fix that and retry the tests

@marcelstoer
Copy link
Contributor Author

marcelstoer commented Aug 24, 2018

No worries, how about that question about the 4.x branch above?

The browser tests failed

Those you did manually? Travis succeeded...

@JamesMessinger
Copy link
Member

The browser tests (SauceLabs) don't run for PRs because Travis CI doesn't set environment variables (e.g. my SauceLabs credentials) for PR builds. So browser tests only run once the PR is merged into Master.

As for the 4.x branch... It's no longer actively supported/maintained. It's mostly just there for archival purposes, and maybe hotfixes. Is there a particular reason you're using 4.x instead of 5.x?

@marcelstoer
Copy link
Contributor Author

Is there a particular reason you're using 4.x instead of 5.x?

I'm not, was just asking out of curiosity. Every project has a different policy.

@JamesMessinger
Copy link
Member

ah, ok. Well let's just leave this on 5.x then. I don't think anybody's even using the 4.x branch anymore.

@argos83
Copy link

argos83 commented Aug 29, 2018

This change broke our builds. I wonder if this could have been released as a major version, or if not a minor version, but not a patch. I seems to me that adding validation logic should be considered as adding a feature. Wdyt?

@marcelstoer
Copy link
Contributor Author

marcelstoer commented Aug 29, 2018

I would want this change to break my builds. It means that my Swagger files haven apparently been invalid so far but it went unnoticed. Or did your builds break for different reasons?

Can't comment on how the maintainer chooses to apply the version scheme.

I seems to me that adding validation logic should be considered as adding a feature.

True, but I guess you could also argue that it's a bug if a Swagger parser/validator doesn't check for duplicate IDs.

@BenSayers
Copy link

I am part of a large organisation who has thousands of builds that depend on libraries like this. When backward incompatible changes like this are released under a patch version and builds are unexpectedly broken it creates significant disruption. I completely agree we want to know when our Swagger files are invalid, however I don't believe the right way to achieve this is to without warning suddenly force everyone to deal with this, despite what other priorities they have.

@JamesMessinger
Copy link
Member

@BenSayers - I apologize for the disruption. I didn't think this would be a breaking change, since it was just adding a check for something that's already part of the Swagger 2.0 spec. But you're right, I should have been more careful and released it as a major or minor version bump, not a patch.

For future reference, you can disable the Swagger spec validation in Swagger Parser by setting the validate.spec option to false. It will still validate your API against the Swagger schema. It just won't run the additional spec-compliancy checks.

var options = {
    validate: {
        spec: false
    },
};

SwaggerParser.validate("my-api.yaml", options, callback);

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

Successfully merging this pull request may close these issues.

None yet

5 participants