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
Using oneOf in openAPI schema makes it impossible to create an instance of some classes in the SDK.
Steps to Reproduce
Using DatasetsControllerFindByIdAndUpdateRequest in the python SDK as an example:
from scicat_sdk_py.models.datasets_controller_find_by_id_and_update_request import DatasetsControllerFindByIdAndUpdateRequest
instance = DatasetsControllerFindByIdAndUpdateRequest.from_dict({"principalInvestigator": "Emil"})
Current Behaviour
This raises a ValueError.
Expected Behaviour
An instance should be created.
Details
The following error is raised: ValueError: Multiple matches found when deserializing the JSON string into DatasetsControllerFindByIdAndUpdateRequest with oneOf schemas: PartialUpdateDerivedDatasetObsoleteDto, PartialUpdateRawDatasetObsoleteDto.
It is my understanding that oneOf should be used in cases where it strictly is one of the schemas. For us this doesn't work because there is overlap between the Dtos (actually they are almost identical).
In our case, anyOf is probably better?
oneOf is used for four endpoints in the datasets controller.
The text was updated successfully, but these errors were encountered:
Summary
Using oneOf in openAPI schema makes it impossible to create an instance of some classes in the SDK.
Steps to Reproduce
Using DatasetsControllerFindByIdAndUpdateRequest in the python SDK as an example:
Current Behaviour
This raises a ValueError.
Expected Behaviour
An instance should be created.
Details
The following error is raised:
ValueError: Multiple matches found when deserializing the JSON string into DatasetsControllerFindByIdAndUpdateRequest with oneOf schemas: PartialUpdateDerivedDatasetObsoleteDto, PartialUpdateRawDatasetObsoleteDto.
It is my understanding that oneOf should be used in cases where it strictly is one of the schemas. For us this doesn't work because there is overlap between the Dtos (actually they are almost identical).
In our case, anyOf is probably better?
oneOf is used for four endpoints in the datasets controller.
The text was updated successfully, but these errors were encountered: