Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better JSON-Schema output for Decimal #692

Merged
merged 3 commits into from
Jan 14, 2024
Merged

Better JSON-Schema output for Decimal #692

merged 3 commits into from
Jan 14, 2024

Conversation

lord-haffi
Copy link
Collaborator

No description provided.

generate_or_validate_json_schemas.py Outdated Show resolved Hide resolved
"""
json_schema = self.str_schema(core_schema.str_schema())
if self.mode == "validation":
json_schema["format"] = "decimal"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nur aus interesse: was macht den der standard schema generator von Pydantic draus und warum funktioniert das nicht? ggf. könnte man ja auch ein issue bei pydantic aufmachen um das langfristig da zu beheben?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pydantic macht quasi ein Union[string, float] draus, was ich ein wenig merkwürdig finde. Wenn du magst, kann ich da ja mal zumindest mal als Nachfrage ein Ticket erstellen.

Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants