Skip to content

Commit

Permalink
bump NJsonSchema and NSwag packages
Browse files Browse the repository at this point in the history
  • Loading branch information
romfir committed Jan 14, 2024
1 parent 63cc303 commit 2640b3d
Show file tree
Hide file tree
Showing 4 changed files with 318 additions and 228 deletions.
8 changes: 4 additions & 4 deletions OpenApiLINQPadDriver/OpenApiContextDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public override List<ExplorerItem> GetSchemaAndBuildAssembly(IConnectionInfo cxI
=> SchemaBuilder.GetSchemaAndBuildAssembly(new OpenApiContextDriverProperties(cxInfo), assemblyToBuild, ref nameSpace, ref typeName);

public override ParameterDescriptor[] GetContextConstructorParameters(IConnectionInfo cxInfo)
=> new[]
{
=>
[
ParameterDescriptors.HttpClient
};
];

public override object[] GetContextConstructorArguments(IConnectionInfo cxInfo)
=> new object[] { new HttpClient() };
=> [new HttpClient()];

public override void InitializeContext(IConnectionInfo cxInfo, object context, QueryExecutionManager executionManager)
{
Expand Down
17 changes: 8 additions & 9 deletions OpenApiLINQPadDriver/OpenApiLINQPadDriver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<PropertyGroup>
<AssemblyName>OpenApiLINQPadDriver</AssemblyName>
<Version>0.0.5-alpha</Version>
<Version>0.0.6-alpha</Version>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Authors>Damian Romanowski (romfir22@gmail.com)</Authors>
<Copyright>Copyright © Damian Romanowski 2023-$([System.DateTime]::Now.Year)</Copyright>
Expand Down Expand Up @@ -62,14 +62,13 @@

<ItemGroup>
<PackageReference Include="LINQPad.Reference" Version="1.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NJsonSchema" Version="10.9.0" />
<PackageReference Include="NJsonSchema.CodeGeneration" Version="10.9.0" />
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.9.0" />
<PackageReference Include="NSwag.CodeGeneration" Version="13.20.0" />
<PackageReference Include="NSwag.CodeGeneration.CSharp" Version="13.20.0" />
<PackageReference Include="NSwag.Core" Version="13.20.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="13.20.0" />
<PackageReference Include="NJsonSchema" Version="11.0.0" />
<PackageReference Include="NJsonSchema.CodeGeneration" Version="11.0.0" />
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="11.0.0" />
<PackageReference Include="NSwag.CodeGeneration" Version="14.0.1" />
<PackageReference Include="NSwag.CodeGeneration.CSharp" Version="14.0.1" />
<PackageReference Include="NSwag.Core" Version="14.0.1" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Prism.Core" Version="8.1.97" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions OpenApiLINQPadDriver/SchemaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ internal static List<ExplorerItem> GetSchemaAndBuildAssembly(OpenApiContextDrive

var endpointGrouping = driverProperties.EndpointGrouping;
var classStyle = driverProperties.ClassStyle;
var settings = CreateCsharpClientGeneratorSettings(endpointGrouping, driverProperties.JsonLibrary, classStyle, driverProperties.GenerateSyncMethods, mainContextType);
var jsonLibrary = driverProperties.JsonLibrary;
var settings = CreateCsharpClientGeneratorSettings(endpointGrouping, jsonLibrary, classStyle, driverProperties.GenerateSyncMethods, mainContextType);

var generator = new CSharpClientGenerator(document, settings);

Expand All @@ -56,7 +57,7 @@ internal static List<ExplorerItem> GetSchemaAndBuildAssembly(OpenApiContextDrive
MeasureTimeAndAddTimeExecutionExplorerItem("Generating clients partials");

var references = driverProperties.GetCoreFxReferenceAssemblies()
.Append(typeof(JsonConvert).Assembly.Location) //required for code generation, otherwise NSwag will use the lowest possible version 10.0.1
.AppendIf(jsonLibrary == JsonLibrary.NewtonsoftJson, typeof(JsonConvert).Assembly.Location)
.AppendIf(classStyle == ClassStyle.Prism, typeof(Prism.IActiveAware).Assembly.Location)
.ToArray();

Expand Down
Loading

0 comments on commit 2640b3d

Please sign in to comment.