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

Swagger definitions shouldn't call newer API's than the Swagger definition #4977

Closed
tombuildsstuff opened this issue Jan 3, 2019 · 4 comments
Assignees

Comments

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Jan 3, 2019

👋🏻

The Go SDK exposes each API Version (Swagger Definition) as it's own SDK - which allows us to select the versions of each service we use. This is helpful in both Sovereign Clouds and Azure Stack where a given API version may not necessarily be rolled out.

Whilst some Swagger Definitions call into earlier API versions when the current API version doesn't expose that functionality (for example 2018-03-01 may define an API call to version 2018-02-01) - my understanding was that this should only be for a previous API version.

When upgrading to v24 of the Azure SDK for Go we've noticed that the Insights API version 2018-03-01 calls into API version 2018-09-01 (which doesn't exist) and thus our tests fail with the following error:

insights.ActionGroupsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'global' and API version '2018-09-01' for type 'actiongroups'. The supported api-versions are '2017-03-01-preview, 2017-04-01, 2018-03-01'. The supported locations are 'global'."

Whilst this bug should be fixed so that it points to a working API version (and there's a bug tracking that here) - my question is whether this should be pointing to a newer API version than is being used in the API definition? As a consumer I'd expect the version of the API I'm selecting is the maximum version being used - as such I'm wondering if a Linter would help catch this bug in the future?

Thanks!

cc @katbyte

@tombuildsstuff
Copy link
Contributor Author

@anuchandy hey - just wondering if there's any thoughts/comments on this? :)

@anuchandy
Copy link
Member

@jhendrixMSFT could you take a kook?

@jhendrixMSFT
Copy link
Member

Good timing, I discovered this while investigating another issue. It appears to have been a copy/paste error, see #5106.
@tombuildsstuff should be fixed in v25, can you try it out?

@anuchandy anuchandy removed their assignment Apr 4, 2019
@akning-ms
Copy link
Contributor

looks it is resolved already, so close this.

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

No branches or pull requests

4 participants