feat(parser): first‑class support for JSON string.format #12
Reference in New Issue
Block a user
Delete Branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat(parser): first‑class support for JSON
string.formatProblem
StringTypeParseralways returned barestr, so a schema likegenerated weakly‑typed models and skipped format validation.
Solution
Added
format_type_mapping→ maps commonformatvalues to Pydantic types.Added
format_pattern_mappingfor formats without built‑ins (hostname).Unknown
formatnow raisesValueErrorearly.Tests
Parametrized success cases for each supported format.
Failure case for unknown format. All new tests pass.
Big thanks to @HideyoshiNakazone for creating and maintaining Jambo—this PR is a small way to give back.
Hey @PuChenTW, thanks a lot for the contribution! I'll take a look at your MR. :)
PR merged! Thanks for the contribution @PuChenTW !
I'm currently implementing the Ref property of the JSON Schema Specification. Once I'm done, I'll make a new feature release with your contribution.
Best regards,
Vitor Hideyoshi