Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Append Format property value to root schema when serializing as v2 if contained in anyOf, allOf, oneOf of child schemas #992

Copy link
Copy link
@irvinesunday

Description

@irvinesunday
Issue body actions

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:

Age:
  format: int64

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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

type:enhancementEnhancement request targeting an existing experienceEnhancement request targeting an existing experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.