lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.32k stars 481 forks source link

Treat null values as no value or undefined #1601

Closed zubialevich closed 2 months ago

zubialevich commented 3 months ago

So I have a model in body that looks like this:

interface Model {
  /**
   * @default undefined
   */
  value?: number;
}

But from the other service I receive null value as an input. I would like in this case the value to be parsed as default instead of throwing a validation exception.

Sorting

Expected Behavior

Parse field with default value

Current Behavior

Throwing Validation exception

Possible Solution

Steps to Reproduce

      1. 4.

Context (Environment)

Version of the library: Version of NodeJS:

Detailed Description

Breaking change?

github-actions[bot] commented 3 months ago

Hello there zubialevich 👋

Thank you for opening your very first issue in this project.

We will try to get back to you as soon as we can.👀

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days