Skip to content

Commit 27a8b07

Browse files
committed
dotnet format tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj
1 parent 20b4cfd commit 27a8b07

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/Kiota.Builder/KiotaBuilder.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,30 +1253,30 @@ openApiExtension is OpenApiPrimaryErrorMessageExtension primaryErrorMessageExten
12531253
(_, _) => null,
12541254
};
12551255
}
1256-
1256+
12571257
private CodeTypeBase? GetPathParameterType(IOpenApiSchema? typeSchema)
12581258
{
12591259
// Check if it's a union type with mixed primitives (anyOf or oneOf) first
1260-
if (typeSchema != null && (typeSchema.AnyOf ?? typeSchema.OneOf) is { Count : > 0 } schemas)
1260+
if (typeSchema != null && (typeSchema.AnyOf ?? typeSchema.OneOf) is { Count: > 0 } schemas)
12611261
{
12621262
var primitiveTypes = schemas.Select(static s => GetPrimitiveType(s)).OfType<CodeType>().ToArray();
1263-
1263+
12641264
// If we found multiple primitive types, create a union type
12651265
if (primitiveTypes.Length > 1)
12661266
{
12671267
var unionType = new CodeUnionType
12681268
{
12691269
Name = "PathParameterUnion"
12701270
};
1271-
1271+
12721272
foreach (var primitiveType in primitiveTypes)
12731273
{
12741274
if (!unionType.ContainsType(primitiveType))
12751275
{
12761276
unionType.AddType(primitiveType);
12771277
}
12781278
}
1279-
1279+
12801280
return unionType;
12811281
}
12821282
// If we only found one primitive type, return it
@@ -1285,11 +1285,11 @@ openApiExtension is OpenApiPrimaryErrorMessageExtension primaryErrorMessageExten
12851285
return primitiveTypes[0];
12861286
}
12871287
}
1288-
1288+
12891289
// Fall back to regular primitive type handling
12901290
return GetPrimitiveType(typeSchema);
12911291
}
1292-
1292+
12931293
private const string RequestBodyPlainTextContentType = "text/plain";
12941294
private const string RequestBodyOctetStreamContentType = "application/octet-stream";
12951295
private const string DefaultResponseIndicator = "default";

tests/Kiota.Builder.Tests/KiotaBuilderTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6687,7 +6687,7 @@ public async Task IndexerTypeIsAccurateAndBackwardCompatibleIndexersAreAddedAsyn
66876687
var actorsItemRequestBuilder = actorsItemRequestBuilderNamespace.FindChildByName<CodeClass>("actorItemRequestBuilder");
66886688
Assert.Equal(actorsCollectionIndexer.ReturnType.Name, actorsItemRequestBuilder.Name);
66896689
}
6690-
6690+
66916691
[Fact]
66926692
public async Task IndexerSupportsUnionOfPrimitiveTypesForPathParametersAsync()
66936693
{
@@ -6740,23 +6740,23 @@ public async Task IndexerSupportsUnionOfPrimitiveTypesForPathParametersAsync()
67406740
var keysCollectionRequestBuilder = keysCollectionRequestBuilderNamespace.FindChildByName<CodeClass>("keysRequestBuilder");
67416741
var keysCollectionIndexer = keysCollectionRequestBuilder.Indexer;
67426742
Assert.NotNull(keysCollectionIndexer);
6743-
6743+
67446744
// Check that the indexer parameter type is a union type containing both string and integer
67456745
var parameterType = keysCollectionIndexer.IndexParameter.Type;
67466746
Assert.IsType<CodeUnionType>(parameterType);
67476747
var unionType = (CodeUnionType)keysCollectionIndexer.IndexParameter.Type;
67486748
Assert.Equal(2, unionType.Types.Count());
6749-
6749+
67506750
// Verify both types are present in the union
67516751
Assert.Contains(unionType.Types, t => t.Name.Equals("string", StringComparison.OrdinalIgnoreCase));
67526752
Assert.Contains(unionType.Types, t => t.Name.Equals("integer", StringComparison.OrdinalIgnoreCase));
6753-
6753+
67546754
// Verify description
67556755
Assert.Equal("Either the ID or the fingerprint of an existing SSH key.", keysCollectionIndexer.IndexParameter.Documentation.DescriptionTemplate);
67566756
Assert.False(keysCollectionIndexer.IndexParameter.Type.IsNullable);
67576757
Assert.False(keysCollectionIndexer.Deprecation.IsDeprecated);
67586758
}
6759-
6759+
67606760
[Fact]
67616761
public async Task IndexerSupportsUnionOfPrimitiveTypesForPathParametersWithOneOfAsync()
67626762
{
@@ -6809,23 +6809,23 @@ public async Task IndexerSupportsUnionOfPrimitiveTypesForPathParametersWithOneOf
68096809
var keysCollectionRequestBuilder = keysCollectionRequestBuilderNamespace.FindChildByName<CodeClass>("keysRequestBuilder");
68106810
var keysCollectionIndexer = keysCollectionRequestBuilder.Indexer;
68116811
Assert.NotNull(keysCollectionIndexer);
6812-
6812+
68136813
// Check that the indexer parameter type is a union type containing both string and integer
68146814
var parameterType = keysCollectionIndexer.IndexParameter.Type;
68156815
Assert.IsType<CodeUnionType>(parameterType);
68166816
var unionType = (CodeUnionType)keysCollectionIndexer.IndexParameter.Type;
68176817
Assert.Equal(2, unionType.Types.Count());
6818-
6818+
68196819
// Verify both types are present in the union
68206820
Assert.Contains(unionType.Types, t => t.Name.Equals("string", StringComparison.OrdinalIgnoreCase));
68216821
Assert.Contains(unionType.Types, t => t.Name.Equals("integer", StringComparison.OrdinalIgnoreCase));
6822-
6822+
68236823
// Verify description
68246824
Assert.Equal("Either the ID or the fingerprint of an existing SSH key.", keysCollectionIndexer.IndexParameter.Documentation.DescriptionTemplate);
68256825
Assert.False(keysCollectionIndexer.IndexParameter.Type.IsNullable);
68266826
Assert.False(keysCollectionIndexer.Deprecation.IsDeprecated);
68276827
}
6828-
6828+
68296829
[Fact]
68306830
public async Task MapsBooleanEnumToBooleanTypeAsync()
68316831
{

0 commit comments

Comments
 (0)