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

Only display API version if present #773

Merged
merged 2 commits into from Jan 17, 2019

Conversation

TheMarex
Copy link
Contributor

@TheMarex TheMarex commented Jan 8, 2019

This only displays the version if it is specified in the info section:

Before

image

After

image

This is useful for OpenAPI specifications that bundle several APIs that are versioned independently, hence the global version string makes little sense.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 82.209% when pulling 4b302d5 on rideOS:no_empty_version into ab943a8 on Rebilly:master.

@RomanHotsiy
Copy link
Member

version field is required according to the OpenAPI spec:

image

@TheMarex
Copy link
Contributor Author

Agreed, the implementation should conform to specs. However, it seems to me that ReDoc generally prefers to degrade in service, rather than fail if it encounters a non-compliant spec.
Given how prevalent per-operation versions are, it is questionable if the OpenAPI standard should have made this a required field in the first place, but this is a discussion for another day.

This changes simply ensures that this degradation of service is more resilient. Given how simple this change this, and that it fixes a real issue, I would advocate for merging this. If your concern is that it makes a non-compliant spec less easy to catch, I can add a warning so it remains discoverable to developers.

@RomanHotsiy
Copy link
Member

However, it seems to me that ReDoc generally prefers to degrade in service, rather than fail if it encounters a non-compliant spec.

@TheMarex agree! Just add a warning, please.

Thanks!

@TheMarex
Copy link
Contributor Author

@RomanGotsiy done!

@RomanHotsiy RomanHotsiy merged commit fb3cb36 into Redocly:master Jan 17, 2019
@RomanHotsiy
Copy link
Member

nice! Thanks!

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Jan 17, 2019

In the end, decided to remove the warning. ReDoc is documentation tool, not a validator :)

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

3 participants