Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to set nullable fields to not required? #1730

Open
2 tasks done
isaac-merkos opened this issue Dec 11, 2024 · 1 comment
Open
2 tasks done

Is there a way to set nullable fields to not required? #1730

isaac-merkos opened this issue Dec 11, 2024 · 1 comment

Comments

@isaac-merkos
Copy link

Sorting

  • I'm submitting a ...

    • support request
  • I confirm that I

    • used the search to make sure that a similar issue hasn't already been submit

I want my generated schema to treat nullable fields as not required, this is related to a bug with the generator I am using (dart), is there a way to do it with tsoa?

I have this utility type that should get me to non required but it's failing when running tsoa spec-and-routes

export type NotRequired<T> = {
  [K in keyof T]: T[K] extends object
    ? NotRequired<T[K]>
    : null extends T[K]
      ? T[K] | undefined
      : T[K];
};
Copy link

Hello there isaac-merkos 👋

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant