Skip to content

Add Spector case for Flatten property#3722

Draft
v-jiaodi wants to merge 1 commit intoAzure:mainfrom
v-jiaodi:add-flatten-case
Draft

Add Spector case for Flatten property#3722
v-jiaodi wants to merge 1 commit intoAzure:mainfrom
v-jiaodi:add-flatten-case

Conversation

@v-jiaodi
Copy link
Member

@v-jiaodi v-jiaodi commented Feb 3, 2026

related pr: Azure/typespec-azure#3729
add case:

  1. Flatten property case for an non-model type like unknown, typespec like this:
model XXX {
  #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
  properties?: unknown;
}

@@Azure.ClientGenerator.Core.Legacy.flattenProperty(XXX.properties);
  1. Flatten property case for all readOnly, typespec like this:
model SolutionProperties {
  @visibility(Lifecycle.Read)
  solutionId?: string;
  @visibility(Lifecycle.Read)
  title?: string;
  @visibility(Lifecycle.Read)
  content?: string;
}
model Solution{
  @Azure.ClientGenerator.Core.Legacy.flattenProperty
  properties: SolutionProperties;
  @Azure.ClientGenerator.Core.Legacy.flattenProperty
  propertiesOptional?: SolutionProperties;
}
op test(@body body:Solution):void;

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.

1 participant