zallek / swagger-diff

Compute the diff between two swagger API specifications.
https://zallek.github.io/swagger-diff/
58 stars 30 forks source link

APIs.guru: showcase and test on real-life APIs #2

Closed IvanGoncharov closed 7 years ago

IvanGoncharov commented 8 years ago

Hi @zallek,

Didn't found your email, so I opened Github issue instead :smile: Maybe you would be interested in testing your tool against 200+ real-life Swagger files: https://github.com/APIs-guru/api-models They are validated by sway and could accessed through my REST API(no key needed).

You can also compare different versions of some popular API like Google Drive: https://apis-guru.github.io/api-models/googleapis.com/drive/v1/swagger.yaml https://apis-guru.github.io/api-models/googleapis.com/drive/v2/swagger.yaml https://apis-guru.github.io/api-models/googleapis.com/drive/v3/swagger.yaml IMHO it will help other developers to see all features of your tool. All links support CORS so you can use it in online demo.

If you have any questions you can ask me directly through Skype(ivangon4arov), Hangout(ivan.goncharov.ua@gmail.com) or you can ask them on public chat: https://gitter.im/APIs-guru/api-models

zallek commented 8 years ago

Hi @IvanGoncharov, thank you for your interest :) What I can tell you is that I'm using this tool at Botify on our API (swagger file) in order to identify changes from one version to another and validate these changes. And we are planning to integrate the tool in our CI to check that API version number is increased accordingly to API interface changes.

Though, I agree that it would be definitely great to have a showcase. I'm currently on other project (related to D3) but I'll take some time to do it.

IvanGoncharov commented 8 years ago

And we are planning to integrate the tool in our CI to check that API version number is increased accordingly to API interface changes.

Cool idea :+1: Right now I working on template for Swagger based API portal: GhPages(hosting) + Travis(validate, Deploy) + ReDoc(alternative to SwaggerUI). I will try to add this check in future.

What I can tell you is that I'm using this tool at Botify on our API (swagger file)

Is that public API? Do you have documentation for it?

I run validator on your Swagger file and found one mistake, you use defaultValue instead of default in JSON Schema definitions. So it result in errors like that:

- code: OBJECT_ADDITIONAL_PROPERTIES
  description: A deterministic version of a JSON Schema object.
  message: 'Additional properties not allowed: defaultValue'
  path:
    - definitions
    - CsvExportStatus
    - properties
    - area
zallek commented 8 years ago

What I can tell you is that I'm using this tool at Botify on our API (swagger file) Is that public API? Do you have documentation for it?

Yes it's public since a few days. Doc: https://developers.botify.com/api/reference/ generated using swagger ui (customized) We are also using this swagger file to generate a basic SDK using APIMATIC.

I didn't know for this validation error, either swagger ui, APIMATIC or the validation in swagger-diff (made by swaggerParser) bothers. But I'm reporting it thanks :)

zallek commented 8 years ago

Actually, you motived me, I'm building a simple web tool to compare two swagger files using swagger-diff. It will be also useful for ourselves :) and to show diff that swagger currently supports and those it doesn't (and so needs contributions :p)

IvanGoncharov commented 8 years ago

Yes it's public since a few days.

I added it to my collection. Thank you for sharing url.

I didn't know for this validation error, either swagger ui, APIMATIC or the validation in swagger-diff (made by swaggerParser) bothers. But I'm reporting it thanks :)

I use sway lib, which is implement many additional checks: https://github.com/apigee-127/sway/tree/master/docs#semantic-validation

Actually, you motived me

:+1: That is actually purpose of my collection, to motivate people create more Web tools which works with Swagger files.

I'm building a simple web tool to compare two swagger files using swagger-diff

Can you please support query parameters to specify Swagger files to compare. Similar to how is done in SwaggerUI: https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html#L35-L38

zallek commented 8 years ago

Can you please support query parameters to specify Swagger files to compare. Similar to how is done in SwaggerUI: https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html#L35-L38

Ok no problem

zallek commented 8 years ago

@IvanGoncharov I've got a problem with api guru. When requesting http://apis-guru.github.io/api-models/googleapis.com/drive/v1/swagger.yaml by the browser I get the following CORS error

XMLHttpRequest cannot load http://apis-guru.github.io/api-models/googleapis.com/drive/v1/swagger.yaml. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:3000' is therefore not allowed access.

EDIT: I got it, I need to use xhr.withCredentials = false to make it works with CORS;

zallek commented 8 years ago

So I start to dev the tool on https://github.com/zallek/swagger-diff-webtool. It's working and able to take some querystring params. I will soon host it on S3 or so.

IvanGoncharov commented 8 years ago

@zallek You can host in gh-pages branch: https://pages.github.com/

zallek commented 8 years ago

Done http://zallek.github.io/swagger-diff/ It's really a first version, result is really raw and I need to add a input to modify config.

Query string params are oldSpecUrl and newSpecUrl (need to be encoded) https://github.com/zallek/swagger-diff/blob/gh-pages/main.js#L8

IvanGoncharov commented 8 years ago

@zallek :+1: