Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1442,8 +1442,8 @@ private void GenerateOptionsOverloads(
{
var requiredParameterList = string.Join(", ", requiredParameters.Select(parameter => $"{MapParameterToJava(parameter)} {ToCamelCase(parameter.Name)}"));
var publicParameterList = string.IsNullOrEmpty(requiredParameterList)
? $"{optionsClassName} options"
: $"{requiredParameterList}, {optionsClassName} options";
? $"{optionsClassName} optionsBag"
: $"{requiredParameterList}, {optionsClassName} optionsBag";

if (!string.IsNullOrEmpty(capability.Description))
{
Expand All @@ -1454,7 +1454,7 @@ private void GenerateOptionsOverloads(
foreach (var parameter in optionalParameters)
{
var paramName = ToCamelCase(parameter.Name);
WriteLine($" var {paramName} = options == null ? null : options.{GetOptionGetterName(parameter)}();");
WriteLine($" var {paramName} = optionsBag == null ? null : optionsBag.{GetOptionGetterName(parameter)}();");
}

var implementationArguments = requiredParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,22 @@ private string MapTypeRefToTypeScript(AtsTypeRef? typeRef)
// ReferenceExpression is a value type defined in base.mts, not a handle-based wrapper
if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId)
{
return GetReferenceExpressionInterfaceName();
return ApplyNullableType(typeRef, GetReferenceExpressionInterfaceName());
}

if (typeRef.TypeId == InputTypeTypeId)
{
return GetInputTypeEnumName();
return ApplyNullableType(typeRef, GetInputTypeEnumName());
}

if (typeRef.TypeId == InteractionInputTypeId)
{
return GetInteractionInputInterfaceName();
return ApplyNullableType(typeRef, GetInteractionInputInterfaceName());
}

if (typeRef.TypeId == InteractionInputCollectionTypeId)
{
return GetInteractionInputCollectionClassName();
return ApplyNullableType(typeRef, GetInteractionInputCollectionClassName());
}

// Check for wrapper class first (handles custom types like resource builders)
Expand Down Expand Up @@ -228,7 +228,7 @@ private string MapTypeRefToTypeScript(AtsTypeRef? typeRef)

private static string ApplyNullableType(AtsTypeRef typeRef, string mappedType)
{
if (typeRef.IsNullable != true || typeRef.Category is not (AtsTypeCategory.Primitive or AtsTypeCategory.Enum))
if (typeRef.IsNullable != true)
{
return mappedType;
}
Expand All @@ -247,9 +247,9 @@ private string MapDtoPropertyTypeToTypeScript(AtsTypeRef? typeRef)

return typeRef.Category switch
{
AtsTypeCategory.Array or AtsTypeCategory.List => $"{MapDtoPropertyTypeToTypeScript(typeRef.ElementType)}[]",
AtsTypeCategory.Dict => $"Record<{MapDtoPropertyTypeToTypeScript(typeRef.KeyType)}, {MapDtoPropertyTypeToTypeScript(typeRef.ValueType)}>",
AtsTypeCategory.Union => MapDtoUnionTypeToTypeScript(typeRef),
AtsTypeCategory.Array or AtsTypeCategory.List => ApplyNullableType(typeRef, $"{MapDtoPropertyTypeToTypeScript(typeRef.ElementType)}[]"),
AtsTypeCategory.Dict => ApplyNullableType(typeRef, $"Record<{MapDtoPropertyTypeToTypeScript(typeRef.KeyType)}, {MapDtoPropertyTypeToTypeScript(typeRef.ValueType)}>"),
AtsTypeCategory.Union => ApplyNullableType(typeRef, MapDtoUnionTypeToTypeScript(typeRef)),
_ => MapTypeRefToTypeScript(typeRef)
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ public sealed class ExecuteCommandContext
/// <summary>
/// The service provider.
/// </summary>
[AspireExportIgnore(Reason = "IServiceProvider is not usable from polyglot command callbacks.")]
public required IServiceProvider ServiceProvider { get; init; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Aspire.Hosting/Ats/AtsTypeMappings.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma warning disable ASPIREINTERACTION001
#pragma warning disable ASPIREPIPELINES001

// Licensed to the .NET Foundation under one or more agreements.
Expand Down Expand Up @@ -53,6 +54,7 @@

// Service types
[assembly: AspireExport(typeof(IServiceProvider))]
[assembly: AspireExport(typeof(IInteractionService))]
[assembly: AspireExport(typeof(ResourceNotificationService))]
[assembly: AspireExport(typeof(ResourceLoggerService))]
[assembly: AspireExport(typeof(ResourceCommandService))]
Expand Down
Loading
Loading