Auto-generate ConfigurationSchema.json for JSON IntelliSense#10139
Draft
Auto-generate ConfigurationSchema.json for JSON IntelliSense#10139
Conversation
Add schema generation for appsettings.json IntelliSense when a client library has ClientSettings. The schema includes well-known client names under 'Clients' (SCM) or 'AzureClients' (Azure) sections, with $ref to shared credential/options definitions and allOf for client-specific option extensions. Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/555ac5bb-bd9c-4d73-90ca-f2922cf55fa5
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/555ac5bb-bd9c-4d73-90ca-f2922cf55fa5
|
|
||
| // Determine if Azure or SCM based on the options base type namespace. | ||
| var optionsBaseType = ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.ClientPipelineOptionsType; | ||
| bool isAzure = optionsBaseType.Namespace?.StartsWith("Azure", StringComparison.Ordinal) == true; |
Contributor
There was a problem hiding this comment.
@copilot we shouldn't have anything related to Azure in the base emitter.
Contributor
Author
There was a problem hiding this comment.
Removed the Azure-specific namespace detection. Generate() now always uses "Clients" and "options" as defaults, with sectionName/optionsRef parameters that a derived emitter can override if needed. Fixed in 3541fb5.
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/555ac5bb-bd9c-4d73-90ca-f2922cf55fa5
Copilot
AI
changed the title
[WIP] Add auto-generate ConfigurationSchema.json for JSON IntelliSense
Auto-generate ConfigurationSchema.json for JSON IntelliSense
Mar 25, 2026
…rator The base emitter should not contain Azure-specific code. Removed the namespace-based Azure detection and made Generate() always use "Clients" and "options" as defaults, with parameters allowing overrides by derived emitters. Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/78f8c1a0-1d00-4e19-89d1-e9090dc2aeab
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/7703f03f-8937-43a3-b716-e0e5f8090658
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WriteAdditionalFiles()virtual method toCodeModelGeneratorConfigurationSchemaGeneratorclass inMicrosoft.TypeSpec.Generator.ClientModelWriteAdditionalFiles()inScmCodeModelGeneratorto invoke schema generationCSharpGen.ExecuteAsync()to write additional output files💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.