mattpolzin / mattpolzin/OpenAPIKit

Support decode of multiple JSON Schema types (other than null)

Open
#211 0 comments 0 reactions 1 assignee View on GitHub

@mattpolzin is already working on this.

Since May 14, 2026.

module: OpenAPIKit schema non-conformance v6.x
Dominant language
Swift
Stars
333
Forks
49
Avg merge
19h 9m
Merged PRs (30d)
10

Description

OpenAPIKit supports combining the JSON Schema null type with one other type as of https://github.com/mattpolzin/OpenAPIKit/pull/210. This allows us to continue to represent schema nullability in an OpenAPI v3.1 document.

What is missing is the ability to decode other combinations of arbitrarily many JSON Schema types. The JSON Schema spec allows it, so OpenAPI v3.1 allows, so we should be able to decode it. I think one way to support this without making drastic changes to the OpenAPIKit JSONSchema types would be to decode "type": ["string", "number"] as if it were a oneOf -- my hope is we do not lose any expressiveness this way. That will mean that encoding a document having decoded it will result in different structure, but if it is at least comparable in what documentation it represents then I think this is an acceptable area for OpenAPIKit to be opinionated about the encoding of the representation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.