-
Notifications
You must be signed in to change notification settings - Fork 9
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
ScheduleTypeLimit: Default None is not carried out to openapi Json #29
Comments
I'm not sure what is the best approach for this. Does it mean that we should always have a default value for numeric fields? |
Having a value of |
Can we make it +infinity for this case? so that pydantic can export this value to json. |
@MingboPeng, do I understand correctly that your issue is that when the value is set to None the 'default' key is not exported to the schema JSON file? In that case we have to see how to get that exported from Pydantic instead of changing the default values from None. |
@MingboPeng and @mostaphaRoudsari , I just explained here how you can tell from the OpenAPI specification if a property has a default of None: |
I am going to close out this issue given that the discussion about this mostly happened over here and we now have a solution to this issue over there. |
@chriswmackey @mostaphaRoudsari
This
Default = None
has been left out when translating to Json file, which causes .Net side a problem when loading the sample ScheduleTypeLimit json file from this repo. Its upperlimit has been set to null, but its value type is float in python (double in C#).This is an issue that double cannot be null in C#. However, I could make this a Nullable double for upper and lower limit, only if it defaults to null in Json .
I do find the float type parameter with default value can be translated to Json, see
radiant_fraction
in people load as an example. I am not sure what causes thisDefault = None
not been translated.Do you have any clue how to fix this?
honeybee-schema/honeybee_schema/energy/schedule.py
Lines 38 to 46 in f9891ee
honeybee-schema/honeybee_schema/energy/load.py
Lines 38 to 43 in f9891ee
The text was updated successfully, but these errors were encountered: