-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add errors fast api #18093
Add errors fast api #18093
Conversation
lib/galaxy/webapps/base/api.py
Outdated
code_int = int(str(code)[:3]) | ||
if code_int in [0, 204] or code_int in responses: | ||
continue | ||
responses[code_int] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if the literals "4XX"
and "5XX"
work (https://swagger.io/docs/specification/describing-responses/) ? I think that would be a bit less verbose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean using 4XX
and 5XX
instead of all the code errors in docs?
It returns this error while updating client API schema: SyntaxError: An identifier or keyword cannot immediately follow a numeric literal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the string "4XX" and "5XX", as listed in the swagger docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns this error while updating client API schema: SyntaxError: An identifier or keyword cannot immediately follow a numeric literal.
I think this is a bug in the version of openapi-typescript
we are using:
https://github.com/galaxyproject/galaxy/actions/runs/9853821142/job/27205208465?pr=18093#step:10:189
Updating it to version 6.7.6
generates the correct typescript schema, but it also changes (probably fixes) some of the types that were generated.
For example:
Record<string, never>
-> unknown
which I think makes more sense and they probably fixed it.
I can try to open a new PR for bumping the openapi-typescript
version and fixing the new type issues in the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davelopez I can pop just that upgrade out of https://github.com/dannon/galaxy/tree/openapi-typescript-fetch-upgrade if we want, following up on the fetcher swapover later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed this earlier 😅
I have a PR just bumping the version to 6.7.6 and fixing the issues in the client. But I agree, we should follow up and try to swap the fetcher later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, sounds good!
7e246d8
to
b6b4f4d
Compare
53e815e
to
16ec128
Compare
…proved error handling
16ec128
to
ba3a24d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks a lot!
Co-authored-by: Marius van den Beek <[email protected]>
Thank you @arash77!! Test failures are unrelated. |
This PR was merged without a "kind/" label, please correct. |
What did you do?
Why did you make this change?
The Validation error should be replaced by the Bad request error as it is not the real model that is returning.
How to test the changes?
License