Retrieving Annotations for Fields in ParseError

Hello everyone, when parsing a schema and getting a
ParseError
, is there a way to retrieve the annotations added to a field inside the error? The problem we want to solve is giving descriptive error message to our end user, because the name of the field isn't obvious as to which field in the UI it's related. Thanks in advance!

Our schema (notice the annotation on startDate):

 ts
export const ProfessionalExperience = S.struct({
  title: S.string,
  startDate: pipe(
    S.to(S.Date),
    S.description("Date de début d'une expérience")
  ), // we should not need S.to here, but only in a transform
  endDate: S.nullable(S.to(S.Date)),
  client: S.string,
  location: S.string,
  description: S.string
})
Was this page helpful?