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
33 changes: 31 additions & 2 deletions tests/Kiota.Builder.IntegrationTests/GenerateSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,41 @@ public async Task GeneratesTodo(GenerationLanguage language, bool backingStore)
var backingStoreSuffix = backingStore ? string.Empty : "BackingStore";
var configuration = new GenerationConfiguration
{
Language = GenerationLanguage.CSharp,
Language = language,
OpenAPIFilePath = "ToDoApi.yaml",
OutputPath = $".\\Generated\\{language}{backingStoreSuffix}",
OutputPath = $".\\Generated\\Todo\\{language}{backingStoreSuffix}",
UsesBackingStore = backingStore,
};
await new KiotaBuilder(logger, configuration).GenerateSDK();
}


[InlineData(GenerationLanguage.CSharp, false)]
[InlineData(GenerationLanguage.Java, false)]
[InlineData(GenerationLanguage.TypeScript, false)]
[InlineData(GenerationLanguage.Go, false)]
[InlineData(GenerationLanguage.Ruby, false)]
[InlineData(GenerationLanguage.CSharp, true)]
[InlineData(GenerationLanguage.Java, true)]
[InlineData(GenerationLanguage.TypeScript, true)]
[Theory]
public async Task GeneratesModelWithDictionary(GenerationLanguage language, bool backingStore)
{
var logger = LoggerFactory.Create((builder) => {
}).CreateLogger<KiotaBuilder>();

var backingStoreSuffix = backingStore ? "BackingStore" : string.Empty;
var configuration = new GenerationConfiguration
{
Language = language,
OpenAPIFilePath = "ModelWithDictionary.yaml",
OutputPath = $".\\Generated\\ModelWithDictionary\\{language}{backingStoreSuffix}",
UsesBackingStore = backingStore,
};
await new KiotaBuilder(logger, configuration).GenerateSDK();
}



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
</ItemGroup>

<ItemGroup>
<None Update="ModelWithDictionary.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="ToDoApi.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
32 changes: 32 additions & 0 deletions tests/Kiota.Builder.IntegrationTests/ModelWithDictionary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
openapi: 3.0.0
info:
title: "Dictionary API"
version: "1.0.0"
servers:
- url: https://example.org/
paths:
/resource:
get:
responses:
200:
description: ok
content:
application/json:
schema:
$ref: "#/components/schemas/resource"
components:
schemas:
resource:
type: object
properties:
info:
type: string
# customSettings: Dictionary<string,string>
customSettings:
type: object
patternProperties:
".*":
type: string