Skip to content

Support nullable values #82

@m4p

Description

@m4p

Commit hash: f530c90

Context:
While testing my application that uses with swift-openapi-generator, I noticed that nullable is not yet supported on Schema Objects values. This leads to a Decoder error for API calls that return null for nullable values.

Steps to reproduce:

  1. Use a OpenAPI spec that relies on nullable values
  2. Make an api call that returns some null values
  3. Expected: Nullable values returned as optionals
  4. Actual: DecodingError: valueNotFound String - Expected String value but found null instead.

$ swift --version
swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0

$ uname -a
Darwin hayai.lan 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 arm64

My system has IPv6 enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/openapiAdding/updating a feature defined in OpenAPI.kind/enhancementImprovements to existing feature.size/SSmall task. (A couple of hours of work.)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions