Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

Enum values are referencable entities but lacked crossLanguageDefinitionId, inconsistent with other SDK types.

Changes

  • interfaces.ts: Added crossLanguageDefinitionId: string property to SdkEnumValueType interface
  • public-utils.ts: Extended getCrossLanguageDefinitionId() to accept EnumMember and generate IDs in format ParentEnum.memberName
  • types.ts: Populated crossLanguageDefinitionId in getSdkEnumValueWithDiagnostics() and getSdkUnionEnumValues()
  • tests: Added coverage for regular and union enum value IDs

Example

For enum WidgetService.Color { Red, Green, Blue }:

// Enum crossLanguageDefinitionId
"WidgetService.Color"

// Enum value crossLanguageDefinitionIds
"WidgetService.Color.Red"
"WidgetService.Color.Green"
"WidgetService.Color.Blue"

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/typespec-azure/typespec-azure/core/website/node_modules/.bin/../astro/astro.js build sh core�� ebsite/src/content/docs/docs/emitters/openapi3/reference node s/.bin/sh warn-as-error --sh . rsioning/referentspd doc . --enable-experimental --output-dir ../../website/src/content/docs/d--output-dir node core�� --noEmit node core/node_modules/.bin/node lint-typespec-liuname pnpm s/.bin/sh tp/reference (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[TCGC] enumvalue types should have crossLanguageDefinitionId</issue_title>
<issue_description>As a "referencable" entity, the enumvalue types should have a crossLanguageDefinitionId.

Actually I suggest we move the crossLanguageDefinitionId to the SdkTypeBase type to ensure every SdkType would have this property.</issue_description>

<agent_instructions>1. Add crossLanguageDefinitionId to the SdkEnumValueType type https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/src/interfaces.ts#L470
2. Use this function and update to accept the enum value type https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/src/public-utils.ts#L241 to get the cross language definition id
3. Add tests in this file https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/test/public-utils/get-cross-language-definition-id.test.ts
</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 13, 2026 20:00
Co-authored-by: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Co-authored-by: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Co-authored-by: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Copilot AI changed the title [WIP] Add crossLanguageDefinitionId to SdkEnumValueType Add crossLanguageDefinitionId to SdkEnumValueType Jan 13, 2026
Copilot AI requested a review from iscai-msft January 13, 2026 20:17
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.

[TCGC] enumvalue types should have crossLanguageDefinitionId

2 participants