-
Notifications
You must be signed in to change notification settings - Fork 56
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
tools/importer-rest-api-specs
: Resource ID parsing now returns map[OperationID]ParsedOperation
rather than map[Uri]ParsedOperation
#3203
Conversation
…2842) This happens when the same URI/Path contains multiple operations with different HTTP Methods which use different values for the Constant segments. This means that dependent on the order these are processed, that we can have eventual consistency/flapping between one constant and another - causing #2842
…e Operation ID rather than URI as the identifier This works around an issue where one URI can contain multiple values for the constant segments, meaning that because we were using a map previously, the parsing order of the map (which would be eventually consistent) would cause flapping on the imported data.
…ogic This was used to pull data from the Data API to allow overriding existing data, which is no longer a technique we're planning to use.
I've gone ahead and imported all of With both this PR and Azure/azure-rest-api-specs#26303 - the following API versions can be imported successfully (and do not appear [based on 3 regenerations of the lot] to be eventually consistent):
Whilst the following API versions have issues:
And we do use currently vendor two of these ( For the sake of completeness, the regeneration errors for the older API versions are: 2014-04-01
2015-05-01-preview
2020-08-01-preview
2020-11-01-preview
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This is possible now that Azure/azure-rest-api-specs#26303 and #3203 have been merged Fixes #2842 Supersedes #2988
This PR refactors how Resource ID parsing is done, such that we utilize the Swagger Operation ID as the key for the map rather than the URI, which fixes an issue seen in SQL (#2842) where the same HTTP Path may have different constant values for each of the HTTP Methods.
Currently the URI being the map key means that we have an eventual consistency issue depending on the ordering in which the operations are parsed - however this fixes this by updating the map to use the Operation ID (which has to be unique).
At least through my testing, this is one part to unblocking #2842 for the latest API Version (
2023-02-01-preview
) - however this also requires a Swagger fix to do so (coming next).Additionally, we need to confirm if this unblocks the remaining API versions - which is next after the PR.