Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make 'x-ms-client-flatten' in typespec-azure-resource-manager templates conditional #709

Closed
3 of 4 tasks
markcowl opened this issue Apr 19, 2024 · 0 comments · Fixed by #1105
Closed
3 of 4 tasks
Assignees
Milestone

Comments

@markcowl
Copy link
Member

markcowl commented Apr 19, 2024

This requires updating the dependencies so that typespec-autorest depends on typespec-azure-resource-manager

  • Add a new decorator @conditionaFlattening which marks a resource as flattened, depending on emitter settings. and an accessor isConditionallyFlattened, both of these apply to model properties
  • Replace all template instances using @OpenApi.extension("x-ms-client-flatten": true) with the @conditionalFlattening` decorator.
  • Add a new option in typespec-autorest arm-resource-flattening with values true and false, defaulting to false. If this option is true, use the isConditionallyFlattened accessor to determine whether to add an x-ms-client-flatten: true to the property representation in OpenAPI
  • Update azure-rest-api-specs, with the new flag set to true in ARM projects
@markcowl markcowl added this to the [2024] May milestone Apr 19, 2024
@markcowl markcowl changed the title Make 'x-ms-client-flatten' conditional Make 'x-ms-client-flatten' in typespec-azure-resource-manager templates conditional Apr 19, 2024
@markcowl markcowl modified the milestones: [2024] May, [2024] June May 7, 2024
@markcowl markcowl self-assigned this May 14, 2024
@markcowl markcowl removed their assignment Jun 17, 2024
@markcowl markcowl modified the milestones: [2024] June, [2024] July Jun 17, 2024
@allenjzhang allenjzhang self-assigned this Jun 25, 2024
github-merge-queue bot pushed a commit that referenced this issue Jul 11, 2024
…ates and make it conditional in autorest (#1105)

Closes #709
pshao25 added a commit to Azure/autorest that referenced this issue Aug 12, 2024
Upgrade tsp version of converter to 0.58

Uptake changes from 

- Azure/typespec-azure#709

1. For brownfield: add flag `arm-resource-flattening`, add
`@@flattenProperty` to properties if needed, direct use of
Azure.ResourceManager.XXXResource allows us not need
`x-ms-client-flatten` any more.
2. For greenfield: no flag `arm-resource-flattening`, no
`@@flattenProperty`

- Azure/typespec-azure#862

Remove all the workaround for Azure.ResourceManager.XXXResource.

---------

Co-authored-by: Pan Shao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants