Skip to content

Add support for nullable schemas (nullable and OAS 3.1 null unions) #88

Description

@YVbakker

Summary

Add support for nullable schemas via OpenAPI nullable and OpenAPI 3.1 union type arrays that include null.

Motivation

Nullability currently causes unsupported paths and potential NotImplementedException.

Scope

  • Handle nullable: true in OpenAPI 3.0 style schemas.
  • Handle OpenAPI 3.1 type arrays, e.g. type: ["string", "null"].
  • Generate nullable CLR types where appropriate (T? for value types, nullable reference handling strategy for reference types).
  • Keep behavior consistent with existing generator conventions.

Acceptance Criteria

  • No NotImplementedException for nullable schema paths.
  • Tests for value type and reference type nullability.
  • Tests for OpenAPI 3.1 union-with-null cases.
  • README notes nullability behavior and limitations.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions