Skip to content

Fix @identifiers decorator, if decorator is passed it has a priority over what is resolved by keys#2538

Merged
AlitzelMendez merged 19 commits intoAzure:mainfrom
AlitzelMendez:fix-identifiers-decorator
Apr 29, 2025
Merged

Fix @identifiers decorator, if decorator is passed it has a priority over what is resolved by keys#2538
AlitzelMendez merged 19 commits intoAzure:mainfrom
AlitzelMendez:fix-identifiers-decorator

Conversation

@AlitzelMendez
Copy link
Copy Markdown
Member

@AlitzelMendez AlitzelMendez commented Apr 14, 2025

  • Fixing gaps on @identifiers decorator

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Apr 14, 2025

All changed packages have been documented.

  • @azure-tools/typespec-autorest
  • @azure-tools/typespec-azure-resource-manager
Show changes

@azure-tools/typespec-autorest - fix ✏️

Fixing gaps in the @identifiers decorator functionality:,> - The @identifier decorator should take priority when present, and its value should be respected.,> - The value of the @identifier decorator is determined by the ModelProperty, not the array type.,> - The @armProviderNamespace is correctly identified in both scenarios: when applied to the array type or the model property.

@azure-tools/typespec-azure-resource-manager - fix ✏️

Fixing gaps in the @identifiers decorator functionality:,> - The @identifier decorator should take priority when present, and its value should be respected.,> - The value of the @identifier decorator is determined by the ModelProperty, not the array type.,> - The @armProviderNamespace is correctly identified in both scenarios: when applied to the array type or the model property.

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Apr 14, 2025

You can try these changes here

🛝 Playground 🌐 Website

@AlitzelMendez AlitzelMendez changed the title Fix @identifiers decorator for name as it is not default Fix @identifiers decorator, if decorator is passed it has a priority over what is resolved by keys Apr 14, 2025
@AlitzelMendez
Copy link
Copy Markdown
Member Author

AlitzelMendez commented Apr 15, 2025

Addressing scenario in where `@identifier` decorator wasn't working as expected:

- `@identifier` should be the priority, when it is defined
- decorator is applied by ModelProperty and not by indexer value
- Identify `@armProviderNamespace` per type definition and modelproperty location

Internal changes:
- Update x-ms-identifiers rule
@AlitzelMendez AlitzelMendez force-pushed the fix-identifiers-decorator branch from 6fee84b to 258041b Compare April 16, 2025 22:22
@AlitzelMendez AlitzelMendez linked an issue Apr 16, 2025 that may be closed by this pull request
@AlitzelMendez AlitzelMendez marked this pull request as ready for review April 16, 2025 22:35
Comment thread packages/typespec-autorest/src/openapi.ts Outdated
Copy link
Copy Markdown
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand why we limit the decorator usage to ARM namespaces. Otherwise, looks ok

Comment thread packages/typespec-autorest/test/openapi-output.test.ts Outdated
@AlitzelMendez AlitzelMendez added this pull request to the merge queue Apr 29, 2025
Merged via the queue into Azure:main with commit 8db39d0 Apr 29, 2025
22 checks passed
@AlitzelMendez AlitzelMendez deleted the fix-identifiers-decorator branch April 29, 2025 04:43
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.

x-ms-identifiers alternative

4 participants