You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenApiSchema copy constructor does not copy Extensions #1261
Describe the bug
The OpenApiSchema copy constructor, i.e. OpenApiSchema.OpenApiSchema(OpenApischema schema) does not copy the OpenApiSchema.Extensions property.
To Reproduce
The following snippet will reproduce the problem:
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
var schema = new OpenApiSchema
{
Extensions =
{
{ "x-myextension", new OpenApiInteger(42) }
}
};
var schemaCopy = new OpenApiSchema(schema);
if (schemaCopy.Extensions.Count != 1)
Console.WriteLine("Extensions were not copied");
Expected behavior
The Extensions property should be copied by the copy constructor.
Activity
MaggieKimani1 commentedon Jun 14, 2023
This was an oversight on my end. Thanks for pointing it out!