Skip to content

Nullable structured types/Entities/Enums are not supported for spec version 2 #1005

Open

Description

Short summary (3-5 sentences) describing the issue.
Currently when choosing to serialize to OpenApiSpec version 2 complex, entity, and enum types have null references. For Enums and Entities, this is always true. This is only true for Structured types when they are nullable.

Assemblies affected

Reader
Which assemblies and versions are known to be affected?
All, as the Reader itself is impacted

Steps to reproduce

Have any nullable complex type and set the spec version to v2. When serialized, those properties that are complex types will be empty.
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.

Expected result

Serialized with a ref
What would happen if there wasn't a bug.

Actual result

Empty
What is actually happening.

Additional detail

This issue is due to the generator always creating the references using "AnyOf". This is correct for OpenApiSpec v3, but v2 does not support AnyOf (or Nullable) and when sent to be serialized these nodes will be left empty.
*Optional, details of the root cause if known.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    type:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions