-
Notifications
You must be signed in to change notification settings - Fork 218
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
Fix issue with operation parameter versioning #2691
Conversation
Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status): Website: https://tspwebsitepr.z22.web.core.windows.net/prs/2691/ |
2abc7c1
to
becbf6f
Compare
becbf6f
to
1d40bd5
Compare
if (paramAvailability !== undefined) { | ||
validateAvailabilityForContains( | ||
program, | ||
operationAvailability, | ||
paramAvailability, | ||
operation, | ||
parameter | ||
); | ||
} else if (paramTypeAvailability !== undefined) { | ||
validateAvailabilityForRef( | ||
program, | ||
operationAvailability, | ||
paramTypeAvailability, | ||
operation, | ||
parameter.type | ||
); | ||
} |
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.
For this to work, I would actually need to build the availability map based on ALL references in the spec, which would be considerably more design and implementation effort. The new test showcases the problem. Thus, I've just removed this check.
@added(Versions.v2) | ||
age: Foo; | ||
} | ||
|
||
@added(Versions.v1) | ||
op oldOp(...Parameters): void; | ||
|
||
@added(Versions.v3) | ||
op newOp(...Parameters): void; |
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.
This is the crux of issue #2688. While this appears to be an error just looking at Parameters and newOp, it makes sense when you consider the existence of oldOp.
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.
Looks good but Maybe good to verify the build completely fix the spec repo validation before merging
Fixes #2688.