Skip to content

Conversation

@jorgerangel-msft
Copy link
Contributor

@jorgerangel-msft jorgerangel-msft commented Nov 4, 2025

This PR fixes an issue where a dynamic model referencing a base model that was not dynamic would lead to generated code that would not compile. The dynamic model decorator will now be propagated to these base types only if the dynamic model subtype is a discriminated type.

fixes: #8926

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

No changes needing a change description found.

@jorgerangel-msft jorgerangel-msft marked this pull request as ready for review November 4, 2025 20:58
@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 4, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@jorgerangel-msft jorgerangel-msft marked this pull request as draft November 4, 2025 21:19
@jorgerangel-msft jorgerangel-msft force-pushed the fix-base-dynamicmodel branch 3 times, most recently from bf2840b to 33e4b90 Compare November 5, 2025 20:51
@jorgerangel-msft jorgerangel-msft changed the title fix: implicitly mark base model types as dynamic fix: implicitly mark discriminated model types as dynamic Nov 5, 2025
@jorgerangel-msft jorgerangel-msft force-pushed the fix-base-dynamicmodel branch 2 times, most recently from ec9095c to 23bd60e Compare November 5, 2025 23:09
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 1, 2025

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@8933
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client@8933
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client-csharp@8933

commit: a93ba84

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Dec 1, 2025
@jorgerangel-msft jorgerangel-msft marked this pull request as ready for review December 1, 2025 23:49
@jorgerangel-msft jorgerangel-msft added this pull request to the merge queue Dec 2, 2025
Merged via the queue into microsoft:main with commit db33781 Dec 2, 2025
22 checks passed
@jorgerangel-msft jorgerangel-msft deleted the fix-base-dynamicmodel branch December 2, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[http-client-csharp] Adding base type to dynamic model leads to compilation errors

3 participants