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.
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.
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
The Regular Expression for the zoning-district-classes {id} path paremeter should:
[x] start with a single letter, of either case
[x] end with an integer with at least one digit
The Regular Expression for the id of ZoningDistrictClassSchema in the OpenAPI, the ZoningDistrictClassEntitySchema in the src/schema, and any other schema reflecting class ids returned from the database should:
[x] start with a single letter, of upper case
[x] end with an integer with at least one digit
Handle case conversion in the application
[x] Services that accept a zoning district class id coming from a path parameter should convert it to uppercase before making calls to the database.
[x] There should be scenarios in the corresponding service unit and e2e tests where a lower case parameter is passed in
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.
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.
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
src/schema
, and any other schema reflecting class ids returned from the database should: