Dapr Components are currently breaking the build / generate process
paule96 opened this issue Β· comments
paule96 commented
π₯ Bug Description
If you have in your aspire manifest a resource that uses Dapr you're will get the following exception:
Error executing action 'SubstituteValuesAspireManifestAction':
System.NotSupportedException: Runtime type 'Aspirate.Shared.Models.AspireManifests.Components.V0.Dapr.DaprComponentResource' is not supported by polymorphic type
'Aspirate.Shared.Models.AspireManifests.Resource'. Path: $.
System.NotSupportedException: Runtime type 'Aspirate.Shared.Models.AspireManifests.Components.V0.Dapr.DaprComponentResource' is not supported by polymorphic type
'Aspirate.Shared.Models.AspireManifests.Resource'.
at void System.Text.Json.ThrowHelper.ThrowNotSupportedException_RuntimeTypeNotSupported(Type baseType, Type runtimeType)
at bool System.Text.Json.Serialization.Metadata.PolymorphicTypeResolver.TryGetDerivedJsonTypeInfo(Type runtimeType, out JsonTypeInfo jsonTypeInfo, out object typeDiscriminator)
at JsonConverter System.Text.Json.Serialization.JsonConverter.ResolvePolymorphicConverter(object value, JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options, ref WriteStack state)
at bool System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, in T value, JsonSerializerOptions options, ref WriteStack state)
at bool System.Text.Json.Serialization.Converters.DictionaryOfTKeyTValueConverter`3.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, ref WriteStack state)
at bool System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryWrite(Utf8JsonWriter writer, TDictionary dictionary, JsonSerializerOptions options, ref WriteStack state)
at bool System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, in T value, JsonSerializerOptions options, ref WriteStack state)
at bool System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, in T value, JsonSerializerOptions options, ref WriteStack state)
at void System.Text.Json.ThrowHelper.ThrowNotSupportedException(ref WriteStack state, NotSupportedException ex)
at bool System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, in T value, JsonSerializerOptions options, ref WriteStack state)
at void System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Serialize(Utf8JsonWriter writer, in T rootValue, object rootValueBoxed)
at string System.Text.Json.JsonSerializer.WriteString<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
at string System.Text.Json.JsonSerializer.Serialize<TValue>(TValue value, JsonSerializerOptions options)
at JsonNode Aspirate.Shared.Extensions.JsonExtensions.TryParseAsJsonNode<T>(T instance) in /home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Shared/Extensions/JsonExtensions.cs:42
at void Aspirate.Processors.Transformation.ResourceExpressionProcessor.ProcessEvaluations(Dictionary<string, Resource> resources) in
/home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Processors/Transformation/ResourceExpressionProcessor.cs:12
at Task<bool> Aspirate.Commands.Actions.Manifests.SubstituteValuesAspireManifestAction.ExecuteAsync() in
/home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Commands/Actions/Manifests/SubstituteValuesAspireManifestAction.cs:9
at async Task<int> Aspirate.Commands.Actions.ActionExecutor.ExecuteCommandsAsync() in /home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Commands/Actions/ActionExecutor.cs:65
The problem seems to be that the DaprComponentResource
is not listed in the attribute list here.
Is this by intention or was this just forgotten with the latest release?
π Steps to Reproduce the Bug
- Create new Aspire project
- Add to your API project as sidecar
- run
aspirate.exe generate
- See error
π§― Possible Solution
Add the attribute for DaprComponentResource
to the Resource
class
David Sekula commented
Sorry about that - it was overlooked, wasn't intentionally left out. Adding now, expect v0.6.4-preview in next ten mins with it added
paule96 commented
Thank you for the fast fix π