Skip to content

[http-client-csharp] Paging fails when page items property is inherited #11576

Description

@live1206

Description

The C# generator reports no-matching-items-property for a paging response when the page-items property is inherited from a base model.

This blocks generation of Azure SDK operations whose response model extends an intermediate Page<T> model, including Azure SDK for .NET issue Azure/azure-sdk-for-net#59567.

Minimal model shape

DerivedPage
  baseModel: BasePage

BasePage
  value: Item[]

pagingMetadata.itemPropertySegments: ["value"]

Root cause

ScmMethodProviderCollection.GetResponseBodyType resolves each paging segment using only modelType.Properties. It does not inspect modelType.BaseModel, so it cannot find an inherited items property even though the input code model and paging metadata are correct.

Expected behavior

Paging item-property resolution should search the current response model and its base-model chain, preserving derived-model precedence.

Validation

A focused ClientModel regression test reproduces the failure by defining value on a base page model and using a derived response model. The expected convenience return type is CollectionResult<Item>.

- by copilot

Metadata

Metadata

Labels

bugSomething isn't workingemitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions