Skip to content

Commit

Permalink
Merge branch 'main' into andrueastman/pythonFix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrueastman authored Nov 13, 2024
2 parents bb2b705 + 5fdd328 commit 7ff7d2f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Kiota.Builder/Kiota.Builder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<ItemGroup>
<PackageReference Include="AsyncKeyedLock" Version="7.1.3" />
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.14.0" />
Expand All @@ -49,7 +49,7 @@
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.22" />
<PackageReference Include="Microsoft.Plugins.Manifest" Version="1.0.0-rc1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
16 changes: 9 additions & 7 deletions src/Kiota.Builder/Refiners/CliRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,17 @@ private static CodeType CreateCommandType(CodeTypeBase.CodeTypeCollectionKind co
}

private static readonly AdditionalUsingEvaluator[] additionalUsingEvaluators =
{
new(x => x is CodeClass { Kind: CodeClassKind.RequestBuilder },
[
new(static x => x is CodeClass { Kind: CodeClassKind.RequestBuilder },
"System.CommandLine", "Command", "RootCommand", "IConsole"),
new(x => x is CodeClass { Kind: CodeClassKind.RequestBuilder },
new(static x => x is CodeClass { Kind: CodeClassKind.RequestBuilder },
"Microsoft.Kiota.Cli.Commons.IO", "IOutputFormatter", "IOutputFormatterFactory", "FormatterType",
"PageLinkData", "IPagingService"),
new(x => x is CodeClass { Kind: CodeClassKind.RequestBuilder },
new(static x => x is CodeClass { Kind: CodeClassKind.RequestBuilder },
"System.Text", "Encoding"),
new(x => x is CodeMethod { Kind: CodeMethodKind.RequestExecutor or CodeMethodKind.RequestGenerator },
"Microsoft.Kiota.Cli.Commons.Extensions", "GetRequestAdapter")
};
new(static x => x is CodeClass { Kind: CodeClassKind.RequestBuilder },
"System.Linq", "Enumerable"),
new(static x => x is CodeMethod { Kind: CodeMethodKind.RequestExecutor or CodeMethodKind.RequestGenerator },
"Microsoft.Kiota.Cli.Commons.Extensions", "GetRequestAdapter"),
];
}
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ protected virtual void WriteCommandHandlerBody(CodeMethod codeElement, CodeClass
if (requestBodyParamType?.TypeDefinition is CodeClass)
{
writer.WriteLine($"using var stream = new MemoryStream(Encoding.UTF8.GetBytes({requestBodyParam.Name}));");
writer.WriteLine($"var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode(\"{generatorMethod.RequestBodyContentType.SanitizeDoubleQuote()}\", stream);");
writer.WriteLine($"var parseNode = await ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNodeAsync(\"{generatorMethod.RequestBodyContentType.SanitizeDoubleQuote()}\", stream, {CancellationTokenParamName});");

var typeString = conventions.GetTypeString(requestBodyParamType, requestBodyParam, false);

Expand Down
10 changes: 5 additions & 5 deletions src/kiota/kiota.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@
<ProjectReference Include="..\Kiota.Builder\Kiota.Builder.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.5-preview" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.22" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="StreamJsonRpc" Version="2.19.27" />
<PackageReference Include="StreamJsonRpc" Version="2.20.17" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.CommandLine.Rendering" Version="0.4.0-alpha.22272.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.SDK" Version="17.11.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="xunit" Version="2.9.2" />
Expand Down

0 comments on commit 7ff7d2f

Please sign in to comment.