(improvement): Adds More Type Formats to String Parser

This commit is contained in:
2025-08-20 00:25:02 -03:00
parent 0a3671974f
commit d3a2f1e76c
3 changed files with 24 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
from jambo import SchemaConverter
from pydantic import BaseModel, HttpUrl
from pydantic import AnyUrl, BaseModel
from ipaddress import IPv4Address, IPv6Address
from unittest import TestCase
@@ -463,7 +463,7 @@ class TestSchemaConverter(TestCase):
}
model = SchemaConverter.build(schema)
self.assertEqual(
model(website="https://example.com").website, HttpUrl("https://example.com")
model(website="https://example.com").website, AnyUrl("https://example.com")
)
with self.assertRaises(ValueError):
model(website="invalid-uri")