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

Review null response in webserver_api.get_service_pricing_plan #6901

Open
pcrespov opened this issue Dec 4, 2024 · 0 comments
Open

Review null response in webserver_api.get_service_pricing_plan #6901

pcrespov opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
bug buggy, it does not work as expected

Comments

@pcrespov
Copy link
Member

pcrespov commented Dec 4, 2024

webserver_api.get_service_pricing_plan can return None and will fail with 500 while serializing the response since response_model=ServicePricingPlanGet,

https://github.com/ITISFoundation/osparc-simcore/blob/master/services/api-server/src/simcore_service_api_server/api/routes/solvers.py#L279

On the other hand, a succesful response from the webserver will never produce a data.None ...
https://github.com/ITISFoundation/osparc-simcore/blob/master/services/api-server/src/simcore_service_api_server/services/webserver.py#L601

Probably it was confusing how Envelope was annotated

class Envelope(BaseModel, Generic[DataT]):
    data: DataT | None = None
    error: Any | None = None
@pcrespov pcrespov added the bug buggy, it does not work as expected label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug buggy, it does not work as expected
Projects
None yet
Development

No branches or pull requests

2 participants