NYCPlanning / ae-zoning-api

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

Refactor: Zoning District Class By Id Schema #168

Closed horatiorosa closed 8 months ago

horatiorosa commented 8 months ago

Description

This ticket covers two related topics. First, the regular expression for the zoning district should be generalized. Second, the id path parameter to request a class should be case-insensitive.

  1. The regular expression used to enforce the zoning district class ID is too specific. It effectively enumerates every existing class and rejects any non-existing classes. The Regex should only enforce the general shape of the structure. It should not have knowledge of the specific instances. We should be able to add classes to the database without the regex becoming invalid. We should generalize the class regex to only enforce the structure, rather than the specific content.

  2. End users should be able to request classes through the zoning-district-classes/{id} with either upper or lower case class ids. However, class Ids are stored as uppercase in the database; we will keep and enforce this pattern. Consequently, the zoning-district-class id path parameter should be case-insensitive. Meanwhile, the Entity Schemas and the schemas returned from the database should enforce capital letters.

Acceptance Criteria