microsoft / microsoft/aspire

ConfigurationSchema only adds a schema for the main resource, not named resources

Open
#8,377 4 comments 0 reactions 0 assignees View on GitHub
area-integrations azure-eventhubs
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Consider a sample service with a dependency
```xml

```

![Image](https://github.com/user-attachments/assets/1de66b10-a0af-4b03-ae18-dde6c76c95ef)

consider I have the following code in my service
```cs
builder.AddAzureEventProcessorClient("hub1");
```

It would be nice having autocomplete in specific event hub configuration, maybe the generated json-schema should have an additional properties where they value can also be the mapping of the object?

no autocomplete here
![Image](https://github.com/user-attachments/assets/ae42916a-e577-475b-9011-9a04176cf7c6)

### Expected Behavior

autocomplete for named resource same as the common resource has.

the configuration pattern seems to not only be for azure but all resources

redis:
https://github.com/dotnet/aspire/blob/22d5ec4c07d614c6b5551acf95df4fa9b575d144/src/Components/Aspire.StackExchange.Redis/AspireRedisExtensions.cs
note the binding
- `configSection.Bind(settings)` - the common configuration
- `namedConfigSection.Bind(settings);` the named configuration
![Image](https://github.com/user-attachments/assets/6b5d7e61-57e5-4fb9-871a-054221e91329)

azure:
https://github.com/dotnet/aspire/blob/f5e596bb038ac396487da4350f78223ebdb9dd26/src/Components/Common/AzureComponent.cs
- `BindSettingsToConfiguration(settings, configSection);` - the common configuration
- `BindSettingsToConfiguration(settings, configSection.GetSection(connectionName));` - the named configuration

![Image](https://github.com/user-attachments/assets/1f6798b7-fef1-438b-8edc-96f01a71e537)

the gap is the only the common configuration has autocomplete, but the named configuration has no autocomplete

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version info

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.