tools/importer-rest-api-specs: Resource ID parsing now returns map[OperationID]ParsedOperation rather than map[Uri]ParsedOperation#3203
Merged
tombuildsstuff merged 5 commits intomainfrom Oct 20, 2023
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.
6 tasks
Contributor
Author
|
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-012015-05-01-preview2020-08-01-preview2020-11-01-preview |
tombuildsstuff
added a commit
that referenced
this pull request
Oct 25, 2023
This is possible now that Azure/azure-rest-api-specs#26303 and #3203 have been merged Fixes #2842 Supersedes #2988
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.