Revert namespace for swashbuckle generated stuff #1245
Triggered via pull request
November 21, 2024 21:34
Status
Failure
Total duration
16m 37s
Artifacts
–
build.yaml
on: pull_request
ubuntu-latest
3m 5s
windows-latest
5m 27s
run-snapshots
16m 25s
macOS-latest
2m 43s
Annotations
37 errors
macOS-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
macOS-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
macOS-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
macOS-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
macOS-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
macOS-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
macOS-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
macOS-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
macOS-latest
Process completed with exit code 1.
|
ubuntu-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
ubuntu-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
ubuntu-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
ubuntu-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
ubuntu-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
ubuntu-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
ubuntu-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
ubuntu-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
ubuntu-latest
Process completed with exit code 1.
|
windows-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
windows-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
windows-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
windows-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
windows-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
windows-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
windows-latest:
samples/WebApplication/Program.cs#L33
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication' (are you missing an assembly reference?)
|
windows-latest:
samples/WebApplication/Program.cs#L34
The type or namespace name 'VogenSwashbuckleExtensions' does not exist in the namespace 'WebApplication.Shared' (are you missing an assembly reference?)
|
windows-latest
Process completed with exit code 1.
|
SnapshotTests.BugFixes.Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\BugFixes\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test.received.txt
Verified: Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test.verified.txt
FileContent:
NotEqual:
Received: Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
public static class VogenSwashbuckleExtensions
{
public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypes(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o)
{
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyLongNamespace.Vo>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<global::System.Nullable<MyLongNamespace.Vo>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true });
return o;
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
namespace generator;
public class VogenTypesFactory : global::System.Text.Json.Serialization.JsonConverterFactory
{
public VogenTypesFactory()
{
}
private static readonly global::System.Collections.Generic.Dictionary<global::System.Type, global::System.Lazy<global::System.Text.Json.Serialization.JsonConverter>> _lookup = new global::System.Collections.Generic.Dictionary<global::System.Type, global::Syste
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_extension_method_for_mapping_types(namespace: "")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_extension_method_for_mapping_types_c61bd4ba08e7d371.received.txt
Verified: SwashbuckleTests.Generates_extension_method_for_mapping_types_c61bd4ba08e7d371.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_extension_method_for_mapping_types_c61bd4ba08e7d371.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
public static class VogenSwashbuckleExtensions
{
public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypes(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o)
{
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyVoInt>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyVoFloat>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyVoDecimal>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyVoDouble>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyVoString>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyVoBool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@Bool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false });
return o;
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_extension_method_for_mapping_types(namespace: "namespace MyNamespace;")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_extension_method_for_mapping_types_999bbcbfced9b3f8.received.txt
Verified: SwashbuckleTests.Generates_extension_method_for_mapping_types_999bbcbfced9b3f8.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_extension_method_for_mapping_types_999bbcbfced9b3f8.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
public static class VogenSwashbuckleExtensions
{
public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypes(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o)
{
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.MyVoInt>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.MyVoFloat>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.MyVoDecimal>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.MyVoDouble>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.MyVoString>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.MyVoBool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.@Bool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false });
return o;
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma w
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_extension_method_for_mapping_types(namespace: "namespace @double;")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_extension_method_for_mapping_types_32176bb7ed8221dd.received.txt
Verified: SwashbuckleTests.Generates_extension_method_for_mapping_types_32176bb7ed8221dd.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_extension_method_for_mapping_types_32176bb7ed8221dd.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
public static class VogenSwashbuckleExtensions
{
public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypes(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o)
{
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@double.MyVoInt>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@double.MyVoFloat>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@double.MyVoDecimal>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@double.MyVoDouble>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@double.MyVoString>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@double.MyVoBool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false });
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@double.@Bool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false });
return o;
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Sup
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_both_filter_and_MapType_extension_method(namespace: "")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_c61bd4ba08e7d371.received.txt
Verified: SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_c61bd4ba08e7d371.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_c61bd4ba08e7d371.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using System.Reflection;
public class VogenSchemaFilter : global::Swashbuckle.AspNetCore.SwaggerGen.ISchemaFilter
{
private const BindingFlags _flags = BindingFlags.Public | BindingFlags.Instance;
public void Apply(global::Microsoft.OpenApi.Models.OpenApiSchema schema, global::Swashbuckle.AspNetCore.SwaggerGen.SchemaFilterContext context)
{
if (context.Type.GetCustomAttribute<Vogen.ValueObjectAttribute>()is not { } attribute)
return;
var type = attribute.GetType();
if (!type.IsGenericType || type.GenericTypeArguments.Length != 1)
{
return;
}
var schemaValueObject = context.SchemaGenerator.GenerateSchema(type.GenericTypeArguments[0], context.SchemaRepository, context.MemberInfo, context.ParameterInfo);
TryCopyPublicProperties(schemaValueObject, schema);
}
private static void TryCopyPublicProperties<T>(T oldObject, T newObject)
where T : class
{
if (ReferenceEquals(oldObject, newObject))
{
return;
}
var type = typeof(T);
var propertyList = type.GetProperties(_flags);
if (propertyList.Length <= 0)
{
return;
}
foreach (var newObjProp in propertyList)
{
var oldProp = type.GetProperty(newObjProp.Name, _flags)!;
if (!oldProp.CanRead || !newObjProp.CanWrite)
{
continue;
}
var value = oldProp.GetValue(oldObject);
newObjProp.SetValue(newObject, value);
}
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning d
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_both_filter_and_MapType_extension_method(namespace: "namespace MyNamespace;")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_999bbcbfced9b3f8.received.txt
Verified: SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_999bbcbfced9b3f8.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_999bbcbfced9b3f8.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using System.Reflection;
public class VogenSchemaFilter : global::Swashbuckle.AspNetCore.SwaggerGen.ISchemaFilter
{
private const BindingFlags _flags = BindingFlags.Public | BindingFlags.Instance;
public void Apply(global::Microsoft.OpenApi.Models.OpenApiSchema schema, global::Swashbuckle.AspNetCore.SwaggerGen.SchemaFilterContext context)
{
if (context.Type.GetCustomAttribute<Vogen.ValueObjectAttribute>()is not { } attribute)
return;
var type = attribute.GetType();
if (!type.IsGenericType || type.GenericTypeArguments.Length != 1)
{
return;
}
var schemaValueObject = context.SchemaGenerator.GenerateSchema(type.GenericTypeArguments[0], context.SchemaRepository, context.MemberInfo, context.ParameterInfo);
TryCopyPublicProperties(schemaValueObject, schema);
}
private static void TryCopyPublicProperties<T>(T oldObject, T newObject)
where T : class
{
if (ReferenceEquals(oldObject, newObject))
{
return;
}
var type = typeof(T);
var propertyList = type.GetProperties(_flags);
if (propertyList.Length <= 0)
{
return;
}
foreach (var newObjProp in propertyList)
{
var oldProp = type.GetProperty(newObjProp.Name, _flags)!;
if (!oldProp.CanRead || !newObjProp.CanWrite)
{
continue;
}
var value = oldProp.GetValue(oldObject);
newObjProp.SetValue(newObject, value);
}
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning d
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_filter_code(namespace: "")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_filter_code_c61bd4ba08e7d371.received.txt
Verified: SwashbuckleTests.Generates_filter_code_c61bd4ba08e7d371.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_filter_code_c61bd4ba08e7d371.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using System.Reflection;
public class VogenSchemaFilter : global::Swashbuckle.AspNetCore.SwaggerGen.ISchemaFilter
{
private const BindingFlags _flags = BindingFlags.Public | BindingFlags.Instance;
public void Apply(global::Microsoft.OpenApi.Models.OpenApiSchema schema, global::Swashbuckle.AspNetCore.SwaggerGen.SchemaFilterContext context)
{
if (context.Type.GetCustomAttribute<Vogen.ValueObjectAttribute>()is not { } attribute)
return;
var type = attribute.GetType();
if (!type.IsGenericType || type.GenericTypeArguments.Length != 1)
{
return;
}
var schemaValueObject = context.SchemaGenerator.GenerateSchema(type.GenericTypeArguments[0], context.SchemaRepository, context.MemberInfo, context.ParameterInfo);
TryCopyPublicProperties(schemaValueObject, schema);
}
private static void TryCopyPublicProperties<T>(T oldObject, T newObject)
where T : class
{
if (ReferenceEquals(oldObject, newObject))
{
return;
}
var type = typeof(T);
var propertyList = type.GetProperties(_flags);
if (propertyList.Length <= 0)
{
return;
}
foreach (var newObjProp in propertyList)
{
var oldProp = type.GetProperty(newObjProp.Name, _flags)!;
if (!oldProp.CanRead || !newObjProp.CanWrite)
{
continue;
}
var value = oldProp.GetValue(oldObject);
newObjProp.SetValue(newObject, value);
}
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_filter_code(namespace: "namespace @double;")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_filter_code_32176bb7ed8221dd.received.txt
Verified: SwashbuckleTests.Generates_filter_code_32176bb7ed8221dd.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_filter_code_32176bb7ed8221dd.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using System.Reflection;
public class VogenSchemaFilter : global::Swashbuckle.AspNetCore.SwaggerGen.ISchemaFilter
{
private const BindingFlags _flags = BindingFlags.Public | BindingFlags.Instance;
public void Apply(global::Microsoft.OpenApi.Models.OpenApiSchema schema, global::Swashbuckle.AspNetCore.SwaggerGen.SchemaFilterContext context)
{
if (context.Type.GetCustomAttribute<Vogen.ValueObjectAttribute>()is not { } attribute)
return;
var type = attribute.GetType();
if (!type.IsGenericType || type.GenericTypeArguments.Length != 1)
{
return;
}
var schemaValueObject = context.SchemaGenerator.GenerateSchema(type.GenericTypeArguments[0], context.SchemaRepository, context.MemberInfo, context.ParameterInfo);
TryCopyPublicProperties(schemaValueObject, schema);
}
private static void TryCopyPublicProperties<T>(T oldObject, T newObject)
where T : class
{
if (ReferenceEquals(oldObject, newObject))
{
return;
}
var type = typeof(T);
var propertyList = type.GetProperties(_flags);
if (propertyList.Length <= 0)
{
return;
}
foreach (var newObjProp in propertyList)
{
var oldProp = type.GetProperty(newObjProp.Name, _flags)!;
if (!oldProp.CanRead || !newObjProp.CanWrite)
{
continue;
}
var value = oldProp.GetValue(oldObject);
newObjProp.SetValue(newObject, value);
}
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should
|
SnapshotTests.OpenApi.SwashbuckleTests.Generates_filter_code(namespace: "namespace MyNamespace;")
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Generates_filter_code_999bbcbfced9b3f8.received.txt
Verified: SwashbuckleTests.Generates_filter_code_999bbcbfced9b3f8.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Generates_filter_code_999bbcbfced9b3f8.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using System.Reflection;
public class VogenSchemaFilter : global::Swashbuckle.AspNetCore.SwaggerGen.ISchemaFilter
{
private const BindingFlags _flags = BindingFlags.Public | BindingFlags.Instance;
public void Apply(global::Microsoft.OpenApi.Models.OpenApiSchema schema, global::Swashbuckle.AspNetCore.SwaggerGen.SchemaFilterContext context)
{
if (context.Type.GetCustomAttribute<Vogen.ValueObjectAttribute>()is not { } attribute)
return;
var type = attribute.GetType();
if (!type.IsGenericType || type.GenericTypeArguments.Length != 1)
{
return;
}
var schemaValueObject = context.SchemaGenerator.GenerateSchema(type.GenericTypeArguments[0], context.SchemaRepository, context.MemberInfo, context.ParameterInfo);
TryCopyPublicProperties(schemaValueObject, schema);
}
private static void TryCopyPublicProperties<T>(T oldObject, T newObject)
where T : class
{
if (ReferenceEquals(oldObject, newObject))
{
return;
}
var type = typeof(T);
var propertyList = type.GetProperties(_flags);
if (propertyList.Length <= 0)
{
return;
}
foreach (var newObjProp in propertyList)
{
var oldProp = type.GetProperty(newObjProp.Name, _flags)!;
if (!oldProp.CanRead || !newObjProp.CanWrite)
{
continue;
}
var value = oldProp.GetValue(oldObject);
newObjProp.SetValue(newObject, value);
}
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should
|
SnapshotTests.OpenApi.SwashbuckleTests.Treats_custom_IParsable_as_string
VerifyException : Directory: D:\a\Vogen\Vogen\tests\SnapshotTests\OpenApi\snapshots\snap-vAspNetCore8.0
NotEqual:
- Received: SwashbuckleTests.Treats_custom_IParsable_as_string.received.txt
Verified: SwashbuckleTests.Treats_custom_IParsable_as_string.verified.txt
FileContent:
NotEqual:
Received: SwashbuckleTests.Treats_custom_IParsable_as_string.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
public static class VogenSwashbuckleExtensions
{
public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypes(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o)
{
global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<MyNamespace.MyVo>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false });
return o;
}
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
namespace generator;
public class VogenTypesFactory : global::System.Text.Json.Serialization.JsonConverterFactory
{
public VogenTypesFactory()
{
}
private static readonly global::System.Collections.Generic.Dictionary<global::System.Type, global::System.Lazy<global::System.Text.Json.Serialization.JsonConverter>> _lookup = new global::System.Collections.Generic.Dictionary<global::System.Type, global::System.Lazy<global::System.Text.Json.Serialization.JsonConverter>>
{
{
typeof(global::MyNamespace.MyVo),
new global::System.Lazy<global::System.Text.Json.Serialization.JsonConverter>(() => new global::MyNamespace.MyVo.MyVoSystemTextJsonConverter())
}
|