Add and export types with the Validation error string literal values - #450
Add and export types with the Validation error string literal values#450joneubank wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
this PR adds four new *Reason type aliases to @overture-stack/lectern-validation, but they're not re-exported from @overture-stack/lectern-client. is that something we want to consider? the curated list in packages/client/src/index.ts (i.e. already re-exporting these other existing types like DictionaryValidationError, FieldValidationError, etc.) doesn't include these new ones.
consumers likely import exclusively from lectern-client, not lectern-validation directly, so importing e.g. DictionaryValidationErrorReason the same way they already import DictionaryValidationRecordErrorDetails may be helpful (otherwise cause an error, or worse split where they import things from).
7da5573 to
fb2e1c4
Compare
|
Circling back since this is the one item still open (#450 (review)), everything else here looks good now (the TSDocs are thorough, and the Small fix: adding the four names to that list, but without it these types aren't actually reachable by the libraries this PR is meant to serve. |
Summary
Add additional type exports that contain the validation reason string literal types. These are derived from the Validation Error union types so if new validation rules are added the Reason types will inherit the added reasons.
Description of Changes
Validation
Added four new exported types which are unions of the error reason literals, for programmatic reference by importing libraries:
which resolve, at the moment, as:
Readiness Checklist
.env.schemafile and documented in the README