When a primitive type schema of the example:
var schema = new OpenApiSchema();
if (context.Settings.IEEE754Compatible)
{
schema.OneOf = new List<OpenApiSchema>
{
new OpenApiSchema { Type = "number", Format = "decimal" },
new OpenApiSchema { Type = "string" },
};
}
The expected serialization for v2 should look like below:
and the expected serialization for v3:
Age:
oneOf:
- type: integer
format: int64
- type: string
nullable: true
This should be applicable to all primitive type schemas.