Skip to content

Typings incorrectly generated in client for request body with a nullable field #3

@DomGeoT

Description

@DomGeoT

Given this schema part:

      Example: {
        type: "object",
        additionalProperties: false,
        properties: {
          exampleXyz: {
            type: "string",
            nullable: false,
          },
        },
        nullable: true,
      },

I would expect a request which uses to be able to pass in the value null for it in the generated open API client. In reality it does not allow a null value. This can be worked around at the minute by ignoring the typings. Or to move the nullable outside the schema e.g.:

ExampleParent: {
  oneOf: [
    {
      $ref: "#/components/schemas/Example",
    },
    {
      type: "null",
    },
  ],
 },

Expected behaviour: the body field can be set to null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions