Skip to content

Commit

Permalink
Merge pull request #1442 from microsoft/baywet-patch-1
Browse files Browse the repository at this point in the history
- maps decimal type to number in typescript
  • Loading branch information
baywet authored Mar 23, 2022
2 parents 24fc832 + 5755d4c commit 1ac24a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Moving middleware from Graph core to kiota http.
- Fixed a bug where errors would fail to deserialize for TypeScript.
- Fixed a bug where decimal types would not be mapped in TypeScript.
- TypeScript adding index exporting models to fix #870.
- Fixed a bug where JSON serialization would fail on nil properties in Go.
- Move typescript core packages into Kiota-TypeScript repo and delete for Kiota repo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private string WriteInlineDeclaration(CodeType currentType, CodeElement targetEl
public override string TranslateType(CodeType type)
{
return type.Name switch {
"integer" or "int64" or "float" or "double" or "byte" or "sbyte" => "number",
"integer" or "int64" or "float" or "double" or "byte" or "sbyte" or "decimal" => "number",
"binary" => "string",
"String" or "Object" or "Boolean" or "Void" or "string" or "object" or "boolean" or "void" => type.Name.ToFirstCharacterLowerCase(), // little casing hack
_ => type.Name.ToFirstCharacterUpperCase() ?? "object",
Expand Down

0 comments on commit 1ac24a2

Please sign in to comment.