NYCPlanning / ae-zoning-api

This application is API for serving data related to zoning and tax lots.
1 stars 0 forks source link

Upgrade kubb version to allow nullable type for capital project category #321

Closed pratishta closed 2 weeks ago

pratishta commented 2 weeks ago

In order to allow a capital project category to be nullable, we can define it in the Open API schema like so:

CapitalProjectCategory:
      type: string
      nullable: true
      enum:
        - Fixed Asset
        - Lump Sum
        - ITT, Vehicles and Equipment
        - null
      description: The type of Capital Project.

However Kubb generates a type and Zod schema that turns null into a string option for the category enum:

export const capitalProjectCategorySchema = z.enum([
  `Fixed Asset`,
  `Lump Sum`,
  `ITT, Vehicles and Equipment`,
  `null`,
]);

This Kubb issue has been documented before here and here. So this ticket will have Kubb upgraded to v 2.19.6 since that's the version that includes the latest fix for this problem.

Acceptance criteria