APIs-guru / openapi-directory

🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
https://apis.guru/
Creative Commons Zero v1.0 Universal
3.87k stars 579 forks source link

Ambiguous preferred specs #777

Open pimterry opened 3 years ago

pimterry commented 3 years ago

There's a couple of specs with the same ids with none clearly marked as the preferred version:

Elmah.io:

Whapi.com/bets:

Googleapis.com/realtimebidding:

MikeRalphson commented 3 years ago

Thanks for reporting this. swagger.yaml and openapi.yaml in the same directory should never happen. I'm hoping they were the result of teething troubles in our scripts rewrite. I'll keep an eye out for it happening again.

I've updated the yaml module used so stray x-preferred: nulls shouldn't get written, and fixed the process where new APIs are detected and automatically added (i.e. from the google API discovery service) so newly added APIs are considered immediately within the x-preferred logic instead of only on the next update run.

pimterry commented 3 years ago

Amazing, sounds great, thanks for the quick fixes!

pimterry commented 1 year ago

Related to the other issue (#542) I've been looking for more duplicates in the latest specs, and I've found there's quite a few new googleapis.com duplicates that match this previous issue:

Duplicate spec id googleapis.com/apigateway between APIs/googleapis.com/apigateway/v1alpha2/openapi.yaml and APIs/googleapis.com/apigateway/v1beta/openapi.yaml
Duplicate spec id googleapis.com/appengine between APIs/googleapis.com/appengine/v1beta/openapi.yaml and APIs/googleapis.com/appengine/v1alpha/openapi.yaml
Duplicate spec id googleapis.com/artifactregistry between APIs/googleapis.com/artifactregistry/v1beta2/openapi.yaml and APIs/googleapis.com/artifactregistry/v1beta1/openapi.yaml
Duplicate spec id googleapis.com/bigtableadmin between APIs/googleapis.com/bigtableadmin/v2/openapi.yaml and APIs/googleapis.com/bigtableadmin/v1/openapi.yaml
Duplicate spec id googleapis.com/blogger between APIs/googleapis.com/blogger/v3/openapi.yaml and APIs/googleapis.com/blogger/v2/openapi.yaml
Duplicate spec id googleapis.com/cloudasset between APIs/googleapis.com/cloudasset/v1p7beta1/openapi.yaml and APIs/googleapis.com/cloudasset/v1p5beta1/openapi.yaml
Duplicate spec id googleapis.com/cloudresourcemanager between APIs/googleapis.com/cloudresourcemanager/v3/openapi.yaml and APIs/googleapis.com/cloudresourcemanager/v2beta1/openapi.yaml
Duplicate spec id googleapis.com/cloudtasks between APIs/googleapis.com/cloudtasks/v2beta2/openapi.yaml and APIs/googleapis.com/cloudtasks/v2beta3/openapi.yaml
Duplicate spec id googleapis.com/containeranalysis between APIs/googleapis.com/containeranalysis/v1beta1/openapi.yaml and APIs/googleapis.com/containeranalysis/v1alpha1/openapi.yaml
Duplicate spec id googleapis.com/doubleclickbidmanager between APIs/googleapis.com/doubleclickbidmanager/v2/openapi.yaml and APIs/googleapis.com/doubleclickbidmanager/v1/openapi.yaml
Duplicate spec id googleapis.com/documentai between APIs/googleapis.com/documentai/v1beta3/openapi.yaml and APIs/googleapis.com/documentai/v1beta2/openapi.yaml
Duplicate spec id googleapis.com/domains between APIs/googleapis.com/domains/v1beta1/openapi.yaml and APIs/googleapis.com/domains/v1alpha2/openapi.yaml
Duplicate spec id googleapis.com/gkehub between APIs/googleapis.com/gkehub/v1beta/openapi.yaml and APIs/googleapis.com/gkehub/v1beta1/openapi.yaml
Duplicate spec id googleapis.com/metastore between APIs/googleapis.com/metastore/v1beta/openapi.yaml and APIs/googleapis.com/metastore/v1alpha/openapi.yaml
Duplicate spec id googleapis.com/oslogin between APIs/googleapis.com/oslogin/v1beta/openapi.yaml and APIs/googleapis.com/oslogin/v1alpha/openapi.yaml
Duplicate spec id googleapis.com/speech between APIs/googleapis.com/speech/v1p1beta1/openapi.yaml and APIs/googleapis.com/speech/v2beta1/openapi.yaml
Duplicate spec id googleapis.com/videointelligence between APIs/googleapis.com/videointelligence/v1p3beta1/openapi.yaml and APIs/googleapis.com/videointelligence/v1p2beta1/openapi.yaml
Duplicate spec id googleapis.com/websecurityscanner between APIs/googleapis.com/websecurityscanner/v1alpha/openapi.yaml and APIs/googleapis.com/websecurityscanner/v1beta/openapi.yaml
Duplicate spec id googleapis.com/youtubeAnalytics between APIs/googleapis.com/youtubeAnalytics/v2/openapi.yaml and APIs/googleapis.com/youtubeAnalytics/v1/openapi.yaml
Duplicate spec id googleapis.com/dfareporting between APIs/googleapis.com/dfareporting/v4/openapi.yaml and APIs/googleapis.com/dfareporting/v3.4/openapi.yaml

It looks like in each case, these are APIs with multiple versions, where at least one version doesn't have x-preferred set, for example googleapis.com/apigateway/v1beta has x-preferred: true set, and the v1 version has x-preferred: false but there's a v1alpha2 version that uses the same provider + service names, but doesn't specify x-preferred at all.