Skip to content

[http-server-csharp] Emit C# class for models extending another model with no additional properties#10175

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-emission-of-baz-model
Draft

[http-server-csharp] Emit C# class for models extending another model with no additional properties#10175
Copilot wants to merge 2 commits intomainfrom
copilot/fix-emission-of-baz-model

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

isEmptyResponseModel treats any model with zero own properties as empty, skipping emission entirely. This means model Baz extends Foo {} never produces a Baz.cs file, even though it's a meaningful derived type users may want to extend via partial classes.

model Foo { id: int32; name: string; }
model Baz extends Foo {}  // No Baz.cs emitted

Changes

  • packages/http-server-csharp/src/lib/utils.ts: isEmptyResponseModel now checks !model.baseModel before treating zero-property models as empty — derived models are always emitted.
  • packages/http-server-csharp/test/generation.test.ts: Added test case verifying a model extending another with no additional properties produces a class file with correct inheritance.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix emission issue for Baz model in C# classes [http-server-csharp] Emit C# class for models extending another model with no additional properties Mar 27, 2026
Copilot AI requested a review from markcowl March 27, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants