swagger-api / validator-badge

Validate your Swagger JSON/YAML today!
http://swagger.io
Apache License 2.0
210 stars 85 forks source link

Check version when 1.2 spec submitted #27

Closed earth2marsh closed 9 years ago

earth2marsh commented 9 years ago

If a spec is submitted, but the version is not supported, then the debug information might explain that. (Even better, validating 1.2 would be great!)

Similarly, since submitting a valid 1.2 spec will always show an "Invalid" badge, that can be misleading. One design workaround might be to always show the version being validated, such as "Valid 2.0" or "Invalid 2.0". (Another approach could be to put the version number in the URL, though it might be ambiguous whether that's the version of the spec or the validator.)

webron commented 9 years ago

The validator is intended for 2.0 only. The UI, for example, will not try to validate earlier versions.

That said, perhaps the error can be clearer. The badge is an interesting option (much like HTML and CSS validators).

fehguy commented 9 years ago

so much to do! I do agree that the validator badge should be hidden or show something different if it's a 1.2 spec.

@earth2marsh how about if we show a badge that somehow, concisely says "this is an old swagger version, upgrade to 2.0" with a link to an upgrade page? Solves many problems.

earth2marsh commented 9 years ago

Yes! I'm totally down with that. The problem is that the online validator works so well, that we should expect folks will try to use 1.2 specs, but then saying those are invalid isn't quite fair. @fehguy 's approach nicely kills two birds with one stone.

fehguy commented 9 years ago

OK this is now supported. Please feel free to send a better image.

webron commented 9 years ago

Finally found something you're not good at, @fehguy.

fehguy commented 9 years ago

there's a long list

webron commented 9 years ago

that's a lie