-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
Swashbucke verison 10.0.0 changed to OpenAPI.NET v2.3 which brings quite some breaking changes to the public API.
See v10.0.0 for details.
Notable the interface ISchemaFilter changed from
public interface ISchemaFilter
{
void Apply(OpenApiSchema schema, SchemaFilterContext context);
}to
public interface ISchemaFilter
{
void Apply(IOpenApiSchema schema, SchemaFilterContext context);
}which leads to Vogen generating an uncompilable 'ISchemaFilter'
public class VogenSchemaFilterMapVogenTypesInReproduceVogenError : global::Swashbuckle.AspNetCore.SwaggerGen.ISchemaFilter
{
private const BindingFlags _flags = BindingFlags.Public | BindingFlags.Instance;
// Symbol not found and unimplemented ISchemaFilter because of that.
public void Apply(global::Microsoft.OpenApi.Models.OpenApiSchema schema, global::Swashbuckle.AspNetCore.SwaggerGen.SchemaFilterContext context)
{
....
}The generated code has to generate global::Microsoft.OpenApi.IOpenApiSchema instead for the Apply method signature
Steps to reproduce
- Create a new project
- Add
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="10.1.0" />
<PackageReference Include="Vogen" Version="8.0.4" />- Set
[assembly: VogenDefaults(openApiSchemaCustomizations: OpenApiSchemaCustomizations.GenerateSwashbuckleSchemaFilter)] - Add a value object
- try to compile the code
Expected behaviour
Vogen should use global::Microsoft.OpenApi.IOpenApiSchema` instead of global::Microsoft.OpenApi.Models.OpenApiSchema` if the swagger gen version is >=10.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working