we see generated Flight class --> validate method has validation only present for seats which is type of Integer .
public static void validate(Flights instance) throws Exception { if (instance.getSeats() < 100) { throw new Exception("seats should not be < 100"); } if (instance.getSeats() > 200) { throw new Exception("seats should not be > 200"); } }
Ideally we should add validation for OCTET String and other data type as well in case missing .
Field Validation After Size Restriction: Even after applying size restrictions, the fields are not validating as expected.
so right now if our ASN file has below code
`Example DEFINITIONS AUTOMATIC TAGS ::= BEGIN
Flights ::= SEQUENCE { origin [0] IMPLICIT OCTET STRING ( SIZE( 3..6 ) ) OPTIONAL, seats INTEGER (100..200) }
END `
we see generated Flight class --> validate method has validation only present for seats which is type of Integer .
public static void validate(Flights instance) throws Exception { if (instance.getSeats() < 100) { throw new Exception("seats should not be < 100"); } if (instance.getSeats() > 200) { throw new Exception("seats should not be > 200"); } }
Ideally we should add validation for OCTET String and other data type as well in case missing .