Description
The library currently lacks a built-in validator for IATA 3-letter codes, which are the standard for city and airport identification in travel and logistics (e.g., NYC, LHR). Developers currently have to reimplement regex pattern matching manually or maintain their own lists of valid codes.
Proposed solution
Add a new @IsIataCityCode() decorator.
This validator should go beyond simple regex matching and verify the existence of the code.
- Format Check: Ensure the input is a 3-letter uppercase string.
- Validity Check: Validate the input against an internal array/set of known active IATA codes (e.g., derived from OpenTravelData or similar open datasets) to ensure the city/airport actually exists.
Example:
@IsIataCityCode()
city: string;
// Valid: "KHI" (Karachi), "LHE" (Lahore)
// Invalid Format: "ny", "Karachi"
// Invalid Code: "ZZZ" (Correct format, but no such IATA code exists)
Description
The library currently lacks a built-in validator for IATA 3-letter codes, which are the standard for city and airport identification in travel and logistics (e.g.,
NYC,LHR). Developers currently have to reimplement regex pattern matching manually or maintain their own lists of valid codes.Proposed solution
Add a new
@IsIataCityCode()decorator.This validator should go beyond simple regex matching and verify the existence of the code.
Example: