You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.
I need some help to fix this issue... for some reason whenever I try to use pyyaml and there is a float value in the middle of my YAML file, dataclasses-jsonschema starts to freak out with the error above.
While I was investigating I discover that the problem is that pyyaml returns ScalarFloat instead of float and dataclasses-jsonschema does not work with ScalarFloat. Do you know any way that I can enforce float values to be returned by pyyaml or if I can include ScalarFloat as part of this project?
Example:
from dataclasses import dataclass
from yaml import safe_load
from dataclasses_jsonschema import JsonSchemaMixin
class Example(JsonSchemaMixin):
field: float
output = safe_load(<path_to_yaml>)
Example.from_dict(output)
Regards,
Lucas Costa Beyeler
The text was updated successfully, but these errors were encountered:
Hi
I need some help to fix this issue... for some reason whenever I try to use pyyaml and there is a float value in the middle of my YAML file, dataclasses-jsonschema starts to freak out with the error above.
While I was investigating I discover that the problem is that pyyaml returns ScalarFloat instead of float and dataclasses-jsonschema does not work with ScalarFloat. Do you know any way that I can enforce float values to be returned by pyyaml or if I can include ScalarFloat as part of this project?
Example:
Regards,
Lucas Costa Beyeler
The text was updated successfully, but these errors were encountered: