Skip to content

Commit

Permalink
Updated all packages and fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Jan 27, 2024
1 parent 30cc71f commit 06752d8
Show file tree
Hide file tree
Showing 19 changed files with 565 additions and 411 deletions.
2 changes: 2 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
/>
<PackageReference Include="Rocket.Surgery.MSBuild.SourceLink" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Polyfill" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<!--
<PackageReference Include="Roslynator.Analyzers" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.Formatting.Analyzers" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.CodeFixes" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.Refactorings" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
-->
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
<PackageVersion Include="HotChocolate.Abstractions" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.AspNetCore" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.Data" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.Diagnostics" Version="14.0.0-tags-13-1-0-preview-5.1" />
<PackageVersion Include="HotChocolate.Diagnostics" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.Execution.Abstractions" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.Data.AutoMapper" Version="14.0.0-tags-13-1-0-preview-5.1" />
<PackageVersion Include="HotChocolate.Data.AutoMapper" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.Data.EntityFramework" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.Data.Spatial" Version="14.0.0-p.29" />
<PackageVersion Include="HotChocolate.Types.Analyzers" Version="14.0.0-p.29" />
Expand Down
102 changes: 88 additions & 14 deletions sample/Sample.Restful.Client/Sample.Restful.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,93 @@
PrivateAssets="All"
ReferenceOutputAssembly="false"
OutputPath="client/$(TargetFramework)/Sample.RestfulClient.cs"
>
<Options
>/generateClientClasses:true /generateClientInterfaces:true /injectHttpClient:true /disposeHttpClient:false /generateExceptionClasses:true /wrapDtoExceptions:true /useBaseUrl:false /generateBaseUrlProperty:false /operationGenerationMode:"MultipleClientsFromFirstTagAndOperationId" /generateOptionalParameters:true /generateJsonMethods:false /enforceFlagEnums:true /parameterArrayType:"System.Collections.Generic.IEnumerable" /parameterDictionaryType:"System.Collections.Generic.IDictionary" /responseArrayType:"System.Collections.Generic.ICollection" /responseDictionaryType:"System.Collections.Generic.IDictionary" /wrapResponses:true /generateResponseClasses:true /responseClass:"Response" /requiredPropertiesMustBeDefined:false /dateType:"System.DateTimeOffset" /dateTimeType:"System.DateTimeOffset" /timeType:"System.TimeSpan" /timeSpanType:"System.TimeSpan" /arrayType:"System.Collections.ObjectModel.Collection" /arrayInstanceType:"System.Collections.ObjectModel.Collection" /dictionaryType:"System.Collections.Generic.IDictionary" /dictionaryInstanceType:"System.Collections.Generic.Dictionary" /arrayBaseType:"System.Collections.ObjectModel.Collection" /dictionaryBaseType:"System.Collections.Generic.Dictionary" /classStyle:"Poco" /generateDefaultValues:true /generateDataAnnotations:true /generateImmutableArrayProperties:true /generateImmutableDictionaryProperties:true /generateDtoTypes:true /generateOptionalPropertiesAsNullable:true</Options>
</OpenApiProjectReference>
</ItemGroup>

<!-- Hack to fix multi-targeting -->
<ItemGroup Condition="Exists('$(OpenApiCodeDirectory)\$(MSBuildProjectName).$(TargetFramework).cs') AND '$(OpenApiGenerateCodeOnBuild)'=='false'">
/>
</ItemGroup>
<Target
Name="_TieInGenerateOpenApiCodeHack"
BeforeTargets="BeforeCompile"
Condition="'$(OpenApiGenerateCodeOnBuild)'=='true'"
DependsOnTargets="GenerateOpenApiCode"
/>

<PropertyGroup>
<NSwagGenerateExceptionClasses>true</NSwagGenerateExceptionClasses>
<NSwagClientBaseClass />
<NSwagConfigurationClass />
<NSwagGenerateClientClasses>true</NSwagGenerateClientClasses>
<NSwagSuppressClientClassesOutput />
<NSwagGenerateClientInterfaces>true</NSwagGenerateClientInterfaces>
<NSwagSuppressClientInterfacesOutput />
<NSwagClientBaseInterface />
<NSwagInjectHttpClient>true</NSwagInjectHttpClient>
<NSwagDisposeHttpClient>false</NSwagDisposeHttpClient>
<NSwagProtectedMethods />
<NSwagExceptionClass />
<NSwagWrapDtoExceptions>true</NSwagWrapDtoExceptions>
<NSwagUseHttpClientCreationMethod />
<NSwagHttpClientType />
<NSwagUseHttpRequestMessageCreationMethod />
<NSwagUseBaseUrl>false</NSwagUseBaseUrl>
<NSwagGenerateBaseUrlProperty>false</NSwagGenerateBaseUrlProperty>
<NSwagGenerateSyncMethods />
<NSwagGeneratePrepareRequestAndProcessResponseAsAsyncMethods />
<NSwagExposeJsonSerializerSettings />
<NSwagClientClassAccessModifier />
<NSwagTypeAccessModifier />
<NSwagGenerateContractsOutput />
<NSwagContractsNamespace />
<NSwagParameterDateTimeFormat />
<NSwagParameterDateFormat />
<NSwagGenerateUpdateJsonSerializerSettingsMethod />
<NSwagUseRequestAndResponseSerializationSettings />
<NSwagSerializeTypeInformation />
<NSwagQueryNullValue />
<NSwagOperationGenerationMode>MultipleClientsFromFirstTagAndOperationId</NSwagOperationGenerationMode>
<NSwagAdditionalNamespaceUsages />
<NSwagAdditionalContractNamespaceUsages />
<NSwagGenerateOptionalParameters>true</NSwagGenerateOptionalParameters>
<NSwagGenerateJsonMethods>false</NSwagGenerateJsonMethods>
<NSwagEnforceFlagEnums>true</NSwagEnforceFlagEnums>
<NSwagParameterArrayType>System.Collections.Generic.IEnumerable</NSwagParameterArrayType>
<NSwagParameterDictionaryType>System.Collections.Generic.IReadOnlyDictionary</NSwagParameterDictionaryType>
<NSwagResponseArrayType>System.Collections.Generic.ICollection</NSwagResponseArrayType>
<NSwagResponseDictionaryType>System.Collections.Generic.IReadOnlyDictionary</NSwagResponseDictionaryType>
<NSwagWrapResponses>true</NSwagWrapResponses>
<NSwagWrapResponseMethods />
<NSwagGenerateResponseClasses>true</NSwagGenerateResponseClasses>
<NSwagResponseClass>Response</NSwagResponseClass>
<NSwagNamespace />
<NSwagRequiredPropertiesMustBeDefined>true</NSwagRequiredPropertiesMustBeDefined>
<!-- <NSwagDateType>NodaTime.LocalDate</NSwagDateType>-->
<NSwagJsonConverters />
<NSwagAnyType />
<!-- <NSwagDateTimeType>NodaTime.LocalDateTime</NSwagDateTimeType>-->
<!-- <NSwagTimeType>NodaTime.LocalTime</NSwagTimeType>-->
<!-- <NSwagTimeSpanType>NodaTime.Duration</NSwagTimeSpanType>-->
<NSwagArrayType>System.Collections.ObjectModel.Collection</NSwagArrayType>
<NSwagArrayInstanceType>System.Collections.ObjectModel.Collection</NSwagArrayInstanceType>
<NSwagDictionaryType>System.Collections.Generic.IDictionary</NSwagDictionaryType>
<NSwagDictionaryInstanceType>System.Collections.Generic.Dictionary</NSwagDictionaryInstanceType>
<NSwagArrayBaseType>System.Collections.ObjectModel.Collection</NSwagArrayBaseType>
<NSwagDictionaryBaseType>System.Collections.Generic.Dictionary</NSwagDictionaryBaseType>
<NSwagClassStyle>POCO</NSwagClassStyle>
<NSwagJsonLibrary />
<NSwagGenerateDefaultValues>true</NSwagGenerateDefaultValues>
<NSwagGenerateDataAnnotations>true</NSwagGenerateDataAnnotations>
<NSwagExcludedTypeNames />
<NSwagExcludedParameterNames />
<NSwagHandleReferences />
<NSwagGenerateImmutableArrayProperties>true</NSwagGenerateImmutableArrayProperties>
<NSwagGenerateImmutableDictionaryProperties>true</NSwagGenerateImmutableDictionaryProperties>
<NSwagJsonSerializerSettingsTransformationMethod />
<NSwagInlineNamedArrays />
<NSwagInlineNamedDictionaries />
<NSwagInlineNamedTuples />
<NSwagInlineNamedAny />
<NSwagGenerateDtoTypes>true</NSwagGenerateDtoTypes>
<NSwagGenerateOptionalPropertiesAsNullable>true</NSwagGenerateOptionalPropertiesAsNullable>
<NSwagGenerateNullableReferenceTypes>true</NSwagGenerateNullableReferenceTypes>
<NSwagTemplateDirectory />
<NSwagTypeNameGeneratorType />
<NSwagPropertyNameGeneratorType />
<NSwagEnumNameGeneratorType />
<NSwagServiceHost />
<NSwagServiceSchemes />
<NSwagOutput />
<NSwagNewLineBehavior />
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/AspNetCore.Blazor/Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static FieldIdentifier ToFieldIdentifier(EditContext editContext, string
propertyPath = propertyPath.Substring(nextTokenEnd + 1);

object? newObj;
if (nextToken.EndsWith("]", StringComparison.OrdinalIgnoreCase))
if (nextToken.EndsWith(']'))
{
// It's an indexer
// This code assumes C# conventions (one indexer named Item with one param)
Expand Down
6 changes: 3 additions & 3 deletions src/AspNetCore/Conventions/FluentValidationConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static void AddFluentValidationRules(IServiceCollection services)
.GetType()
.GetProperties(BindingFlags.Instance | BindingFlags.NonPublic)
.First(z => z.PropertyType == typeof(ValidationRuleContext))
.GetValue(context))
.GetValue(context)!)
.GetReflectionContext();
var propertyType = ruleContext?.PropertyInfo?.DeclaringType;
if (propertyType == typeof(string))
Expand All @@ -58,7 +58,7 @@ private static void AddFluentValidationRules(IServiceCollection services)
.GetType()
.GetProperties(BindingFlags.Instance | BindingFlags.NonPublic)
.First(z => z.PropertyType == typeof(ValidationRuleContext))
.GetValue(context))
.GetValue(context)!)
.GetReflectionContext();
var propertyType = ruleContext?.PropertyInfo?.DeclaringType;
if (propertyType != null &&
Expand All @@ -81,7 +81,7 @@ private static void AddFluentValidationRules(IServiceCollection services)
.GetType()
.GetProperties(BindingFlags.Instance | BindingFlags.NonPublic)
.First(z => z.PropertyType == typeof(ValidationRuleContext))
.GetValue(context))
.GetValue(context)!)
.GetReflectionContext();
context.Schema.Properties[context.PropertyKey].Nullable =
context.PropertyValidator is not (INotNullValidator or INotEmptyValidator)
Expand Down
16 changes: 12 additions & 4 deletions src/Serilog/Conventions/SerilogReadFromConfigurationConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ namespace Rocket.Surgery.LaunchPad.Serilog.Conventions;
public class SerilogReadFromConfigurationConvention : ISerilogConvention, IConfigurationConvention
{
/// <inheritdoc />
#if NET6_0_OR_GREATER
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification
= "The type is an enum value")]
#endif
#if NET6_0_OR_GREATER
[UnconditionalSuppressMessage(
"Trimming",
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
Justification = "The type is an enum value"
)]
[UnconditionalSuppressMessage(
"Trimming",
"IL2066:The generic parameter of type or method has a DynamicallyAccessedMembersAttribute, but the value used for it can not be statically analyzed.",
Justification = "The type is an enum value"
)]
#endif
public void Register(IConventionContext context, IConfiguration configuration, IConfigurationBuilder builder)
{
if (context == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using Rocket.Surgery.Conventions;
using Rocket.Surgery.Conventions.DependencyInjection;
using StrawberryShake.Serialization;

namespace Rocket.Surgery.LaunchPad.StrawberryShake.Spatial.Conventions;

Expand All @@ -15,7 +16,7 @@ public class StrawberryShakeSpatialConvention : IServiceConvention
/// <inheritdoc />
public void Register(IConventionContext context, IConfiguration configuration, IServiceCollection services)
{
services.AddSerializer<GeometrySerializer>();
services.AddSingleton<ISerializer, GeometrySerializer>();
// services.AddSerializer<CoordinatesSerializer>();
}
}
23 changes: 12 additions & 11 deletions src/StrawberryShake/Conventions/StrawberryShakeConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using Rocket.Surgery.Conventions;
using Rocket.Surgery.Conventions.DependencyInjection;
using StrawberryShake.Serialization;

namespace Rocket.Surgery.LaunchPad.StrawberryShake.Conventions;

Expand All @@ -15,16 +16,16 @@ public class StrawberryShakeConvention : IServiceConvention
/// <inheritdoc />
public void Register(IConventionContext context, IConfiguration configuration, IServiceCollection services)
{
services.AddSerializer<InstantSerializer>();
services.AddSerializer<LocalDateSerializer>();
services.AddSerializer<LocalTimeSerializer>();
services.AddSerializer<LocalDateTimeSerializer>();
services.AddSerializer<OffsetDateTimeSerializer>();
services.AddSerializer<OffsetTimeSerializer>();
services.AddSerializer<PeriodSerializer>();
services.AddSerializer<DurationSerializer>();
services.AddSerializer<ZonedDateTimeSerializer>();
services.AddSerializer<OffsetSerializer>();
services.AddSerializer<IsoDayOfWeekSerializer>();
services.AddSingleton<ISerializer, InstantSerializer>();
services.AddSingleton<ISerializer, LocalDateSerializer>();
services.AddSingleton<ISerializer, LocalTimeSerializer>();
services.AddSingleton<ISerializer, LocalDateTimeSerializer>();
services.AddSingleton<ISerializer, OffsetDateTimeSerializer>();
services.AddSingleton<ISerializer, OffsetTimeSerializer>();
services.AddSingleton<ISerializer, PeriodSerializer>();
services.AddSingleton<ISerializer, DurationSerializer>();
services.AddSingleton<ISerializer, ZonedDateTimeSerializer>();
services.AddSingleton<ISerializer, OffsetSerializer>();
services.AddSingleton<ISerializer, IsoDayOfWeekSerializer>();
}
}
7 changes: 3 additions & 4 deletions test/Analyzers.Tests/ControllerActionBodyGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Analyzers.Tests;

[UsesVerify]
public class ControllerActionBodyGeneratorTests : GeneratorTest
{
[Fact]
Expand Down Expand Up @@ -485,7 +484,7 @@ public static class GetRocketLaunchRecord
public record Request : IRequest<LaunchRecordModel>
{
public Guid Id { get; init; }
public Guid LaunchId { get; init; }
}
}",
Expand Down Expand Up @@ -529,7 +528,7 @@ public static class GetRocketLaunchRecord
public record Request : IRequest<LaunchRecordModel>
{
public Guid Id { get; init; }
public Guid LaunchRecordId { get; init; }
}
}",
Expand Down Expand Up @@ -573,7 +572,7 @@ public static class GetRocketLaunchRecord
public record Request : IRequest<LaunchRecordModel>
{
public Guid Id { get; init; }
public string LaunchRecordId { get; init; }
}
}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Analyzers.Tests;

[UsesVerify]
public class GraphqlMutationActionBodyGeneratorTests : GeneratorTest
{
[Fact]
Expand Down Expand Up @@ -198,7 +197,7 @@ public static class GetRocketLaunchRecord
public record Request : IRequest<LaunchRecordModel>
{
public Guid Id { get; init; }
public Guid LaunchId { get; init; }
}
}",
Expand Down Expand Up @@ -238,7 +237,7 @@ public static class GetRocketLaunchRecord
public record Request : IRequest<LaunchRecordModel>
{
public Guid Id { get; init; }
public Guid LaunchRecordId { get; init; }
}
}",
Expand Down Expand Up @@ -278,7 +277,7 @@ public static class GetRocketLaunchRecord
public record Request : IRequest<LaunchRecordModel>
{
public Guid Id { get; init; }
public string LaunchRecordId { get; init; }
}
}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Analyzers.Tests;

[UsesVerify]
public class GraphqlOptionalPropertyTrackingGeneratorTests : GeneratorTest
{
[Fact]
Expand All @@ -28,7 +27,7 @@ public class Request : IRequest<RocketModel>
}
public class PatchGraphRocket : IOptionalTracking<Request>, IRequest<RocketModel>
{
public Guid Id { get; init; }
public Guid Id { get; init; }
}
}
";
Expand Down Expand Up @@ -58,7 +57,7 @@ public static class PublicClass
{
public partial record PatchGraphRocket : IOptionalTracking<Request>, IRequest<RocketModel>
{
public Guid Id { get; init; }
public Guid Id { get; init; }
}
}
}
Expand Down
1 change: 0 additions & 1 deletion test/Analyzers.Tests/InheritFromGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace Analyzers.Tests;

[UsesVerify]
public class InheritFromGeneratorTests : GeneratorTest
{
[Fact]
Expand Down
5 changes: 2 additions & 3 deletions test/Analyzers.Tests/PropertyTrackingGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Analyzers.Tests;

[UsesVerify]
public class PropertyTrackingGeneratorTests : GeneratorTest
{
[Fact]
Expand All @@ -24,7 +23,7 @@ public class Request : IRequest<RocketModel>
}
public class PatchRocket : IPropertyTracking<Request>, IRequest<RocketModel>
{
public Guid Id { get; init; }
public Guid Id { get; init; }
}
}
";
Expand Down Expand Up @@ -53,7 +52,7 @@ public static class PublicClass
{
public partial record PatchRocket : IPropertyTracking<Request>, IRequest<RocketModel>
{
public Guid Id { get; init; }
public Guid Id { get; init; }
}
}
}
Expand Down
1 change: 0 additions & 1 deletion test/Extensions.Tests/SerilogDestructuringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Extensions.Tests;

[UsesVerify]
public class SerilogDestructuringTests : LoggerTest
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace Extensions.Tests.Validation;

[UsesVerify]
public class HealthCheckOptionsValidationTests(ITestOutputHelper outputHelper) : AutoFakeTest(outputHelper), IAsyncLifetime
{
[Fact]
Expand Down
1 change: 0 additions & 1 deletion test/Extensions.Tests/Validation/OptionsValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Extensions.Tests.Validation;

[UsesVerify]
public class OptionsValidationTests(ITestOutputHelper outputHelper) : AutoFakeTest(outputHelper), IAsyncLifetime
{
[Fact]
Expand Down
Loading

0 comments on commit 06752d8

Please sign in to comment.