Skip to content

Incorrect schema generation for NonNullable of union type #2286

Open
@loucadufault

Description

@loucadufault

Seems like a very simple repro:

Simpler repro:

export type SomeType = {
  foo: NonNullable<'a' | 'b'>
}
{
  "$ref": "#/definitions/RelaxedMatchedHeadline",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "RelaxedMatchedHeadline": {
      "properties": {
        "foo": {
          "anyOf": [
            {
              "properties": {},
              "type": "object"
            },
            {
              "properties": {},
              "type": "object"
            }
          ]
        }
      },
      "type": "object"
    }
  }
}

on @2.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions