4 Commits

Author SHA1 Message Date
81c149120e Merge pull request #50 from fredsonnenwald/string_format
Fix Field deprecation warning resulting from building models with formatted strings
2025-09-15 19:18:20 -03:00
171dddabab Merge pull request #51 from HideyoshiNakazone/chore/adds-pyright-config
chore: adds pyright config to project
2025-09-15 13:55:26 -03:00
f0192ee6d3 chore: adds pyright config to project 2025-09-15 13:54:32 -03:00
Fred Sonnenwald
82feea0ab1 Fix string Field deprecation warning
(partial revert of fbbff0b)
2025-09-15 16:50:49 +01:00
2 changed files with 9 additions and 1 deletions

View File

@@ -19,7 +19,6 @@ class StringTypeParser(GenericTypeParser):
"maxLength": "max_length",
"minLength": "min_length",
"pattern": "pattern",
"format": "format",
}
format_type_mapping = {
@@ -63,4 +62,8 @@ class StringTypeParser(GenericTypeParser):
if format_type in self.format_pattern_mapping:
mapped_properties["pattern"] = self.format_pattern_mapping[format_type]
if "json_schema_extra" not in mapped_properties:
mapped_properties["json_schema_extra"] = {}
mapped_properties["json_schema_extra"]["format"] = format_type
return mapped_type, mapped_properties

View File

@@ -87,3 +87,8 @@ section-order=[
"standard-library",
]
lines-after-imports = 2
[tool.pyright]
venvPath = "."
venv = ".venv"