-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
fix: update http exception's schema construction to include items key… #2999
base: main
Are you sure you want to change the base?
fix: update http exception's schema construction to include items key… #2999
Conversation
a574f20
to
bf04119
Compare
@nathanielarking this looks good to me but it's still in draft mode. Is there any more work you want to do here? |
@nathanielarking It seems like our TypeScript generation assumes the faulty schema this PR fixes. Do you feel comfortable fixing this as well? Additionally, after consulting the OA 3 spec, it seems that a list of
https://swagger.io/docs/specification/data-models/data-types/ Maybe we should disallow passing a list there in the first place. @guacs? |
This constraint specified in the provided link is for 3.0, but we are using 3.1 which does allow multiple types to be provided for
The ibm-avoid-multiple-types states that following:
That is, it's part of their linting rules for the spec, but it's not in violation of the spec. However, I feel this is a reasonable rule though and we could default to not using multiple types and instead only provide one type per |
Heyo @provinzkraut @guacs, thanks for taking a look at this. I had made the initial commits but didn't have time to look into why the CI was failing and if changes needed to be made to any tests. Is that related to the TS changes mentioned? I'll have time later this week to check things out some more. |
Yes, those are the tests that are failing. |
An Openapi schema is generated for every HttpException passed into the
raises
kwargs of a route handler. The schema for theextra
attribute of the HttpException currently generates this schema:This schema fails to comply with two rules of the IBM openapi validator, ibm-avoid-multiple-types and ibm-array-attributes. This causes sdk generation with Orval to fail.
This PR changes the schema generation for the HttpException to generate this: