165 writes to Category
Aspire.Hosting.CodeGeneration.Java.Tests (44)
AtsJavaCodeGeneratorTests.cs (44)
2698
new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = MutableStringDict() });
2714
Category
= AtsTypeCategory.List,
2728
var stringType = new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive };
2729
var innerArray = new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = stringType };
2732
new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = innerArray });
2775
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
2776
var stringType = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive };
2777
var innerArray = new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = stringType };
2778
var matrixType = new AtsTypeRef { TypeId = "array",
Category
= AtsTypeCategory.Array, ElementType = innerArray };
2783
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
2785
CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
2792
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
2813
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
2817
Type = new AtsTypeRef { TypeId = AtsConstants.CancellationToken,
Category
= AtsTypeCategory.Dto }
2824
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
2841
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
2860
Category
= AtsTypeCategory.Primitive,
2886
Category
= AtsTypeCategory.Handle
2893
new AtsTypeRef { TypeId = AtsConstants.Boolean,
Category
= AtsTypeCategory.Primitive, IsNullable = true }),
2897
new AtsTypeRef { TypeId = AtsConstants.Number,
Category
= AtsTypeCategory.Primitive, IsNullable = true }));
3015
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
3019
Category
= AtsTypeCategory.Primitive,
3025
Category
= AtsTypeCategory.Primitive,
3031
Category
= AtsTypeCategory.Array,
3037
Category
= AtsTypeCategory.Array,
3043
Category
= AtsTypeCategory.Array,
3050
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
3056
CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
3063
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
3271
var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext",
Category
= AtsTypeCategory.Dto };
3287
Type = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive }
3300
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
3309
Category
= AtsTypeCategory.Primitive
3362
var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource",
Category
= AtsTypeCategory.Handle };
3363
var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext",
Category
= AtsTypeCategory.Dto };
3368
Type = new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback },
3373
CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
3380
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
3402
Type = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive }
3589
Type = new AtsTypeRef { TypeId = "KeywordProbe",
Category
= AtsTypeCategory.Dto }
3648
new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive });
3680
Category
= AtsTypeCategory.Dict,
3682
KeyType = new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive },
3683
ValueType = new AtsTypeRef { TypeId = "string",
Category
= AtsTypeCategory.Primitive }
Aspire.Hosting.CodeGeneration.Python.Tests (19)
AtsPythonCodeGeneratorTests.cs (19)
500
Category
= AtsTypeCategory.Handle
524
Category
= AtsTypeCategory.Primitive
556
Category
= AtsTypeCategory.Handle
580
Category
= AtsTypeCategory.Primitive
615
Category
= AtsTypeCategory.Handle
622
Category
= AtsTypeCategory.Handle,
630
Category
= AtsTypeCategory.Handle,
654
Category
= AtsTypeCategory.Primitive
694
Category
= AtsTypeCategory.Union,
700
Category
= AtsTypeCategory.Union,
706
Category
= AtsTypeCategory.Primitive,
714
Category
= AtsTypeCategory.Primitive
749
Category
= AtsTypeCategory.Array,
753
Category
= AtsTypeCategory.Primitive,
763
Category
= AtsTypeCategory.Primitive
799
Category
= AtsTypeCategory.Primitive
805
Category
= AtsTypeCategory.Primitive
812
Category
= AtsTypeCategory.Handle
819
Category
= AtsTypeCategory.Handle
Aspire.Hosting.CodeGeneration.TypeScript.Tests (30)
AtsTypeScriptCodeGeneratorTests.cs (30)
276
Category
= AtsTypeCategory.Handle
281
Category
= AtsTypeCategory.Primitive
890
Category
= AtsTypeCategory.Primitive,
896
Category
= AtsTypeCategory.Array,
947
Category
= AtsTypeCategory.Union,
963
Category
= AtsTypeCategory.Primitive
968
Category
= AtsTypeCategory.List,
974
Category
= AtsTypeCategory.Dict,
990
Category
= AtsTypeCategory.Primitive,
996
Category
= AtsTypeCategory.Dict,
997
KeyType = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive },
1001
Category
= AtsTypeCategory.List,
1577
Category
= AtsTypeCategory.Handle
1838
Category
= AtsTypeCategory.Handle
1850
Category
= AtsTypeCategory.Primitive
1875
Category
= AtsTypeCategory.Primitive
2834
Category
= AtsTypeCategory.Handle
2839
Category
= AtsTypeCategory.Primitive
2844
Category
= AtsTypeCategory.Primitive
3039
Category
= AtsTypeCategory.Handle
3047
Category
= AtsTypeCategory.Handle
3133
Category
= AtsTypeCategory.Handle
3148
Category
= AtsTypeCategory.Primitive
3251
Category
= AtsTypeCategory.Handle
3266
Category
= AtsTypeCategory.Callback
3281
Category
= AtsTypeCategory.Primitive
3288
Category
= AtsTypeCategory.Primitive
3315
Category
= AtsTypeCategory.Primitive
3324
Category
= AtsTypeCategory.Primitive
3332
Category
= AtsTypeCategory.Primitive
Aspire.Hosting.RemoteHost (40)
Ats\AtsMarshaller.cs (1)
428
Category
= _context.GetCategory(type)
Ats\ExternalCapabilityRegistry.cs (2)
796
: new AtsTypeRef { TypeId = "unknown",
Category
= AtsTypeCategory.Unknown }
809
Category
= typeRef.Category,
AtsCapabilityScanner.cs (35)
770
typeRef.
Category
= AtsTypeCategory.Handle;
930
Category
= AtsTypeCategory.Handle,
961
Category
= AtsTypeCategory.Handle,
1171
? new AtsTypeRef { TypeId = "callback", ClrType = prop.PropertyType,
Category
= AtsTypeCategory.Callback }
1691
: new AtsTypeRef { TypeId = AtsConstants.Any,
Category
= AtsTypeCategory.Primitive };
1696
Category
= AtsTypeCategory.Dict,
1718
propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any,
Category
= AtsTypeCategory.Primitive };
2231
? new AtsTypeRef { TypeId = "callback",
Category
= AtsTypeCategory.Callback }
2288
returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2292
returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2300
?? new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
2301
: new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2306
?? new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive }
2334
var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive };
2670
Category
= AtsTypeCategory.Primitive
2686
Category
= typeRef.Category,
2764
return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type,
Category
= AtsTypeCategory.Primitive };
2770
return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type,
Category
= AtsTypeCategory.Primitive };
2779
Category
= AtsTypeCategory.Dict,
2780
KeyType = new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string),
Category
= AtsTypeCategory.Primitive },
2781
ValueType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object),
Category
= AtsTypeCategory.Primitive },
2792
Category
= AtsTypeCategory.List,
2793
ElementType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object),
Category
= AtsTypeCategory.Primitive }
2807
Category
= AtsTypeCategory.Enum
2830
Category
= AtsTypeCategory.Dict,
2853
Category
= AtsTypeCategory.Dict,
2875
Category
= AtsTypeCategory.List,
2895
Category
= AtsTypeCategory.Array,
2940
Category
= AtsTypeCategory.Array,
2956
Category
= AtsTypeCategory.Dto,
2968
Category
= AtsTypeCategory.Handle,
2978
Category
= AtsTypeCategory.Unknown,
3073
Category
= AtsTypeCategory.Handle,
3140
Category
= AtsTypeCategory.Handle,
3398
Category
= AtsTypeCategory.Union,
AtsContextFilter.cs (2)
326
Category
= AtsTypeCategory.Handle,
345
Category
= AtsTypeCategory.Primitive
Aspire.Hosting.RemoteHost.Tests (32)
AtsContextFilterTests.cs (17)
192
Category
= AtsTypeCategory.Dto
199
Category
= AtsTypeCategory.Handle
206
Category
= AtsTypeCategory.Handle,
278
Category
= AtsTypeCategory.Enum
285
Type = new AtsTypeRef { TypeId = AtsConstants.Void,
Category
= AtsTypeCategory.Primitive },
296
Category
= AtsTypeCategory.Enum
436
Category
= AtsTypeCategory.Enum
489
Category
= AtsTypeCategory.Enum
509
Category
= AtsTypeCategory.Handle
519
Category
= AtsTypeCategory.Dto
529
Category
= AtsTypeCategory.Enum
537
Category
= AtsTypeCategory.Handle,
545
Category
= AtsTypeCategory.Handle
562
Category
= AtsTypeCategory.Handle
580
Category
= AtsTypeCategory.Primitive
593
Category
= AtsTypeCategory.Dto
606
Category
= AtsTypeCategory.Primitive
AtsMarshallerTests.cs (12)
172
Category
= AtsTypeCategory.Union,
175
new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string),
Category
= AtsTypeCategory.Primitive },
176
new AtsTypeRef { TypeId = AtsConstants.Number, ClrType = typeof(int),
Category
= AtsTypeCategory.Primitive },
177
new AtsTypeRef { TypeId = AtsConstants.Boolean, ClrType = typeof(bool),
Category
= AtsTypeCategory.Primitive }
195
Category
= AtsTypeCategory.Union,
198
new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string),
Category
= AtsTypeCategory.Primitive },
199
new AtsTypeRef { TypeId = "test/IResource", ClrType = typeof(IResource),
Category
= AtsTypeCategory.Handle }
217
Category
= AtsTypeCategory.Union,
220
new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string),
Category
= AtsTypeCategory.Primitive },
221
new AtsTypeRef { TypeId = AtsConstants.Boolean, ClrType = typeof(bool),
Category
= AtsTypeCategory.Primitive }
294
Category
= AtsTypeCategory.Primitive
1021
var typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto",
Category
= AtsTypeCategory.Dto };
ExternalCapabilityRegistryTests.cs (3)
894
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Boolean,
Category
= AtsTypeCategory.Primitive }
920
ReturnType = new AtsTypeRef { TypeId = AtsConstants.Boolean,
Category
= AtsTypeCategory.Primitive }
964
Type = new AtsTypeRef { TypeId = AtsConstants.String,
Category
= AtsTypeCategory.Primitive },
108 references to Category
Aspire.Hosting.CodeGeneration.Go (16)
AtsGoCodeGenerator.cs (15)
320
if (typeRef.
Category
== AtsTypeCategory.Handle)
691
var renderedValue = typeRef.
Category
switch
709
var valueType = typeRef.
Category
== AtsTypeCategory.Primitive
875
if (capability.ReturnType.
Category
!= AtsTypeCategory.List
876
&& capability.ReturnType.
Category
!= AtsTypeCategory.Dict)
1177
if (returnType.
Category
!= AtsTypeCategory.Handle)
1398
if (p.Type?.
Category
!= AtsTypeCategory.Handle) { continue; }
1584
else if (p.CallbackParameters is { Count: > 0 } callbackParameters && callbackParameters.Any(cp => cp.Type.
Category
== AtsTypeCategory.Dto))
1599
if (callbackParameters[i].Type.
Category
== AtsTypeCategory.Dto)
1637
if (returnType.
Category
== AtsTypeCategory.Dict)
1837
if (p.Type?.
Category
== AtsTypeCategory.Union)
1909
if (hasReturn && capability.ReturnType!.
Category
== AtsTypeCategory.Handle)
2103
var baseType = typeRef.
Category
switch
2141
var baseType = typeRef.
Category
switch
2165
&& typeRef.
Category
is AtsTypeCategory.Primitive or AtsTypeCategory.Enum
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54
if (candidate.Type?.
Category
!= AtsTypeCategory.Dto)
Aspire.Hosting.CodeGeneration.Java (15)
AtsJavaCodeGenerator.cs (15)
876
return typeRef.
Category
switch
1138
if (parameter.IsCallback || parameter.Type?.
Category
!= AtsTypeCategory.Handle)
2060
var converted = typeRef.
Category
switch
2101
if (typeRef?.
Category
is not (AtsTypeCategory.Dict or AtsTypeCategory.Array or AtsTypeCategory.List))
2108
if (typeRef.
Category
== AtsTypeCategory.List)
2124
if (typeRef.
Category
== AtsTypeCategory.Array)
2250
return returnType.
Category
== AtsTypeCategory.List || returnType.
Category
== AtsTypeCategory.Dict;
2256
var isDict = returnType.
Category
== AtsTypeCategory.Dict;
2573
return typeRef.
Category
switch
2605
return typeRef.
Category
switch
2679
private static bool IsUnionType(AtsTypeRef? typeRef) => typeRef?.
Category
== AtsTypeCategory.Union;
2702
if (typeRef.
Category
== AtsTypeCategory.Handle)
2715
if (typeRef.
Category
== AtsTypeCategory.List)
2722
else if (typeRef.
Category
== AtsTypeCategory.Dict)
Aspire.Hosting.CodeGeneration.Python (15)
AtsPythonCodeGenerator.cs (15)
158
typeRef != null && typeRef.
Category
== AtsTypeCategory.Handle;
220
var mappedType = typeRef.
Category
switch
246
&& typeRef.
Category
is AtsTypeCategory.Primitive or AtsTypeCategory.Enum
521
if (typeRef.
Category
== AtsTypeCategory.Union)
528
if (typeRef.
Category
== AtsTypeCategory.Primitive && typeRef.TypeId == AtsConstants.Void)
598
return typeRef.
Category
switch
997
expression = typeRef.
Category
switch
1009
if (!topLevel || typeRef.
Category
is AtsTypeCategory.Primitive)
1365
var isResourceBuilder = capability.ReturnType != null && capability.ReturnType.
Category
== AtsTypeCategory.Handle &&
1438
if (capability.ReturnType != null && (capability.ReturnType.
Category
== AtsTypeCategory.Handle || capability.ReturnType.
Category
== AtsTypeCategory.Dto))
1923
if (targetTypeRef.
Category
!= AtsTypeCategory.Handle)
2172
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.Handle)
2176
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.Dict)
2180
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.List)
Aspire.Hosting.CodeGeneration.Rust (19)
AtsRustCodeGenerator.cs (19)
381
return typeRef.
Category
switch
615
else if (returnTypeRef?.
Category
== AtsTypeCategory.Dict && returnTypeRef.IsReadOnly == false)
621
else if (returnTypeRef?.
Category
== AtsTypeCategory.List && returnTypeRef.IsReadOnly == false)
654
return returnType.
Category
== AtsTypeCategory.List || returnType.
Category
== AtsTypeCategory.Dict;
662
var isDict = returnType.
Category
== AtsTypeCategory.Dict;
910
var baseType = typeRef.
Category
switch
948
var baseType = typeRef.
Category
switch
988
var baseType = typeRef.
Category
switch
1035
if (typeRef.
Category
== AtsTypeCategory.Primitive)
1061
&& typeRef.
Category
is AtsTypeCategory.Primitive or AtsTypeCategory.Enum
1065
typeRef?.
Category
== AtsTypeCategory.Handle
1071
&& (typeRef.
Category
== AtsTypeCategory.Array || (typeRef.
Category
== AtsTypeCategory.List && typeRef.IsReadOnly))
1077
&& ((typeRef.
Category
== AtsTypeCategory.List && !typeRef.IsReadOnly)
1078
|| (typeRef.
Category
== AtsTypeCategory.Dict && !typeRef.IsReadOnly));
1101
if (typeRef.
Category
== AtsTypeCategory.Handle)
1114
if (typeRef.
Category
== AtsTypeCategory.List || typeRef.
Category
== AtsTypeCategory.Dict)
Aspire.Hosting.CodeGeneration.TypeScript (18)
AtsTypeScriptCodeGenerator.cs (2)
385
if (typeRef?.
Category
!= AtsTypeCategory.Dto ||
400
if (typeRef?.
Category
!= AtsTypeCategory.Dto ||
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54
if (candidate.Type?.
Category
!= AtsTypeCategory.Dto)
TypeScriptApiProjector.cs (15)
759
return exportedValue.Type.
Category
is AtsTypeCategory.Primitive
771
return typeRef.
Category
switch
1648
typeRef is {
Category
: AtsTypeCategory.Handle };
1689
var mappedType = typeRef.
Category
switch
1710
if (typeRef.IsNullable != true || typeRef.
Category
is not (AtsTypeCategory.Primitive or AtsTypeCategory.Enum))
1727
return typeRef.
Category
switch
1738
var requiresGrouping = elementType?.
Category
== AtsTypeCategory.Union ||
1739
elementType is { IsNullable: true,
Category
: AtsTypeCategory.Primitive or AtsTypeCategory.Enum };
1859
if (typeRef?.
Category
== AtsTypeCategory.Union)
2008
return typeRef.
Category
== AtsTypeCategory.Handle && typeRef.IsInterface;
2551
if (typeRef.
Category
== AtsTypeCategory.Union && typeRef.UnionTypes is { Count: > 0 })
2625
return typeRef?.
Category
== AtsTypeCategory.Dict;
2634
return typeRef?.
Category
== AtsTypeCategory.List;
2667
if (targetTypeRef.
Category
!= AtsTypeCategory.Handle)
2942
if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.
Category
== AtsTypeCategory.Handle)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (5)
AtsTypeScriptCodeGeneratorTests.cs (5)
854
Assert.Equal(AtsTypeCategory.Handle, dependencyParam.Type.
Category
);
2252
Assert.Equal(AtsTypeCategory.Primitive, ctParam.Type.
Category
);
2324
Assert.Equal(AtsTypeCategory.Dto, options.Type.
Category
);
2340
Assert.Equal(AtsTypeCategory.Handle, legacyOptions.Type.
Category
);
2481
Assert.NotEqual(AtsTypeCategory.Unknown, param.Type.
Category
);
Aspire.Hosting.RemoteHost (9)
Ats\AtsMarshaller.cs (2)
155
return typeRef.
Category
switch
165
_ => throw new InvalidOperationException($"Unknown type category: {typeRef.
Category
}")
AtsCapabilityScanner.cs (5)
684
if (typeRef.
Category
== AtsTypeCategory.Enum && typeRef.ClrType != null)
768
if (typeRef.
Category
== AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId))
863
if (typeRef.
Category
== AtsTypeCategory.Unknown)
1384
return typeRef.
Category
switch
2686
Category = typeRef.
Category
,
AtsContextFilter.cs (1)
394
if (typeRef.
Category
== AtsTypeCategory.Handle && !string.IsNullOrEmpty(typeRef.TypeId))
CodeGeneration\CodeGenerationService.cs (1)
151
Category = t.
Category
.ToString(),
Aspire.Hosting.RemoteHost.Tests (11)
AtsCapabilityScannerTests.cs (11)
161
Assert.Equal(AtsTypeCategory.Array, itemsType.
Category
);
166
Assert.Equal(AtsTypeCategory.Array, enumerableReturnCapability.ReturnType.
Category
);
177
Assert.Equal(AtsTypeCategory.Array, typeRef.
Category
);
192
Assert.Equal(AtsTypeCategory.Union, parameter.Type?.
Category
);
336
Assert.Equal(AtsTypeCategory.Union, resourceParameter.Type?.
Category
);
342
Assert.Equal(AtsTypeCategory.Dict, argumentsParameter.Type?.
Category
);
425
Assert.Equal(AtsTypeCategory.Dto, optionsParameter.Type.
Category
);
442
Assert.Equal(AtsTypeCategory.Handle, callbackParameter.Type.
Category
);
444
Assert.Equal(AtsTypeCategory.Dto, prepareRequestProperty.CallbackReturnType?.
Category
);
664
Assert.NotEqual(AtsTypeCategory.Unknown, cbParam.Type.
Category
);
683
Assert.Equal(AtsTypeCategory.Handle, parameter.Type.
Category
);