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

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

Copy link
Copy link
@mispeer

Description

@mispeer
Issue body actions

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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugA broken experienceA broken 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.