Skip to content

Commit

Permalink
- fixes #221 adds support for file generation type
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed May 16, 2022
1 parent 5aa370b commit f114c81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ private static CodeType GetPrimitiveType(OpenApiSchema typeSchema, string childT
var format = typeSchema?.Format ?? typeSchema?.Items?.Format;
var primitiveTypeName = (typeName?.ToLowerInvariant(), format?.ToLowerInvariant()) switch {
("string", "base64url") => "binary",
("file", _) => "binary",
("string", "duration") => "TimeSpan",
("string", "time") => "TimeOnly",
("string", "date") => "DateOnly",
Expand Down
1 change: 1 addition & 0 deletions tests/Kiota.Builder.Tests/KiotaBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ public void InheritedTypeWithInlineSchemaWorks() {
[InlineData("boolean", "", "boolean")]
[InlineData("", "byte", "binary")]
[InlineData("", "binary", "binary")]
[InlineData("file", null, "binary")]
[Theory]
public void MapsPrimitiveFormats(string type, string format, string expected){
var document = new OpenApiDocument() {
Expand Down

0 comments on commit f114c81

Please sign in to comment.