We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Originally posted by rrevo May 26, 2024 The Typespec file below does not compile
import "@typespec/http"; import "@typespec/rest"; import "@typespec/versioning"; using TypeSpec.Versioning; @versioned(Versions) @service({ title: "Widget Service", }) namespace DemoService; enum Versions { v1, v2, v3 } using TypeSpec.Http; using TypeSpec.Rest; model Widget { color: "red" | "blue"; @added(Versions.v2) name: string; // FAIL } @added(Versions.v3) model Widget3 is Widget { fancyField: string }
with the failure 'DemoService.Widget3' was added in version 'v3' but contains type 'DemoService.Widget3.name' added in version 'v2'.
I wanted to model v1 followed by v2 followed by v3. However based on how I've declared the models, it looks like v2 and v3 are considered independent.
How can this versioning dependency be resolved? Or is it a bug in Typespec?
Thanks
The text was updated successfully, but these errors were encountered:
Allow spreading a model that has props added in previous version (#3911)
10488de
fix [#3639](#3639) Allow this scenario ``` model Base { @added(Versions.v1) name: string; } @added(Versions.v2) model Child { ...Base; } ```
timotheeguerin
Successfully merging a pull request may close this issue.
Discussed in #3455
Originally posted by rrevo May 26, 2024
The Typespec file below does not compile
with the failure
'DemoService.Widget3' was added in version 'v3' but contains type 'DemoService.Widget3.name' added in version 'v2'.
I wanted to model v1 followed by v2 followed by v3. However based on how I've declared the models, it looks like v2 and v3 are considered independent.
How can this versioning dependency be resolved? Or is it a bug in Typespec?
Thanks
The text was updated successfully, but these errors were encountered: