Skip to content

PickProperties/OmitProperties does not project referenced properties to composed model meta #7673

Open
@guesant

Description

@guesant

When I have a model that extends a {Omit/Pick}Properties, no matter if using ... (spread) or is or extends, the model should be able to be intelligent of the properties that comes from the base model. Instead, it's giving the error:

Model doesn't have member <property>

Image

model User {
  id: string;

  name: string;
  country: string;

  phone: string;
}

model UserView {
  ...OmitProperties<User, "phone">
}

model UserFindOneInput {
  id: UserView.id
}

model UserFindOneOutput {
  ...UserView
}

Playground Link

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:coreIssues for @typespec/compilerdesign:neededA design request has been raised that needs a proposaltriaged:core

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions