Skip to content

Possible missing pieces from generated code #4

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

Open
longquanzheng opened this issue Aug 14, 2023 · 1 comment
Open

Possible missing pieces from generated code #4

longquanzheng opened this issue Aug 14, 2023 · 1 comment
Labels
low-priority won't fix This will not be worked on

Comments

@longquanzheng
Copy link
Contributor

When updating the IDL:

➜  iwf-python-sdk git:(main) ✗ poetry run openapi-python-client update --path iwf-idl/iwf-sdk.yaml --config .openapi-python-client-config.yaml

Updating iwf_api
Warning(s) encountered while generating. Client was generated, but some pieces may be missing

WARNING parsing POST /api/v1/workflow/getWithWait within default.

Invalid response status code 420 (not a valid HTTP status code), response will be ommitted from generated client


WARNING parsing POST /api/v1/workflow/rpc within default.

Invalid response status code 420 (not a valid HTTP status code), response will be ommitted from generated client

@lwolczynski
Copy link
Contributor

lwolczynski commented Apr 24, 2025

420 and 450 are not valid HTTP Status codes, and openapi-python-client will not generate the code for those:
https://github.com/openapi-generators/openapi-python-client/blob/c0f76a336cb858fe401564e29622faa8403a0948/openapi_python_client/parser/openapi.py#L167

We still can process these as done here:

except errors.UnexpectedStatus as err:
err_resp = parse_unexpected_error(err)
if err.status_code == 420:
raise WorkflowRPCExecutionError(err.status_code, err_resp)
if err.status_code == 450:
raise WorkflowRPCAcquiringLockFailure(err.status_code, err_resp)
else:
raise RuntimeError(f"unknown error code {err.status_code}")

There is no way to mute this warning. The only way around it would be to switch to using real HTTP Statuses like 408 or 422.

'420':
        description: wait has exceeded timeout
        # 408
'420':
        description: RPC execution error
        # 422
'450':
        description: RPC acquire locking failure   

@lwolczynski lwolczynski added the won't fix This will not be worked on label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low-priority won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants