Skip to content

[Azure .NET Generator] Override ConfigurationSchema.json generation to use AzureClients section #56785

@m-nash

Description

@m-nash

Overview

Parent issue: #56777

The base .NET emitter (microsoft/typespec#9922) will auto-generate ConfigurationSchema.json with the well-known client name under the Clients top-level section. The Azure emitter needs to override this to place Azure SDK clients under the AzureClients section instead.

Why this is needed

  • System.ClientModel clients (base emitter) → Clients section in appsettings.json
  • Azure.Core clients (Azure emitter) → AzureClients section in appsettings.json

The base emitter doesn't know about the AzureClients section — it only generates schema entries under Clients. The Azure emitter must override the schema generation to:

  1. Place the well-known client name under AzureClients instead of Clients
  2. Reference azureOptions (which includes Retry + Diagnostics) instead of the base options
  3. Reference the Azure.Identity credential definition instead of the SCM credential

What to do

Override the base emitter's ConfigurationSchema.json generation in the Azure generator to:

  • Output the schema to the package's schema/ directory (sibling of src/)
  • Use AzureClients as the top-level section key
  • Use $ref to #/definitions/azureOptions for the Options property
  • Use $ref to #/definitions/credential (Azure.Identity's definition) for the Credential property
  • Include any client-specific options that extend azureOptions via allOf

Reference

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageCodeGenIssues that relate to code generation

Type

No type

Projects

Status

Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions