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
Would anyone know of a way to remove the enforced default:None when converting an OpenApi 3.0.1 yaml document to Pydantic models for later usage?
As of now I see that every model has the following (unless an default value is explicitly stated in the yaml):
My issue is that when comes time to validate a JSON response, some fields which should be part of the model against which the response is validated are ignored without error. However, I've noticed that when the None default field value is removed, then errors are captured (missing or invalid field).
Maybe I'm missing something here. I thought the --strip-default-none would remove None but it is not.
Any ideas would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered:
Would anyone know of a way to remove the enforced
default:None
when converting an OpenApi 3.0.1 yaml document to Pydantic models for later usage?As of now I see that every model has the following (unless an default value is explicitly stated in the yaml):
My issue is that when comes time to validate a JSON response, some fields which should be part of the model against which the response is validated are ignored without error. However, I've noticed that when the None default field value is removed, then errors are captured (missing or invalid field).
Maybe I'm missing something here. I thought the
--strip-default-none
would remove None but it is not.Any ideas would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: