-
Notifications
You must be signed in to change notification settings - Fork 4.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
fix: various nullable resources in OpenAPI config #12260
fix: various nullable resources in OpenAPI config #12260
Conversation
Hey @azhard thank you for this PR.
@cgardens suggested that we change the server behavior to make sure the response from the server does not contain the field that are not required if they are This change will prevent this kind of PR and the need to declare a lot of fields as nullable in our open API spec. |
Hey @alafanechere, my strong preference for this would be to handle this from the server side and I'd also be more than happy to submit a PR to fix that if pointed in the right direction but like you not familiar enough with that code to make the changes. So for now, this feels like a band-aid solution but still a solution at least. |
@azhard I can try to point you in the right direction for potentially fixing this on the server side. I think your best bet would be to search for places in code where we construct generated API response objects that include the OpenAPI components you've identified, and then see if we can add handling for cases where the OpenAPI component is null. For example, I'll try to walk through this process for First of all, note that I'm searching in my local project because the generated code in question isn't checked in to Github.
I hope that is useful, I think this approach should be able to guide you to make necessary updates for all of the cases you identified. Let me know if you have any follow up questions! |
This is a dangerous bandaid. It i setting a bad precedent that it is okay to compromise the API interface. We need to make sure we do the right fix before it gets exploited. |
What
Fixes a few instances of the problem mentioned in #10774 by setting the OpenAPI component schemas as
nullable: true
Specifically adds nullability to the following:
CustomerioNotificationConfiguration
OperatorDbt
AttemptStats
AttemptFailureSummary
ResourceRequirements
How
Simply add
nullable: true
to the base component so that any operation that uses the component accepts the null version.Recommended reading order
N/A
🚨 User Impact 🚨
Will allow users to better rely on generated clients from the Airbyte OpenAPI config - no breaking changes.
Pre-merge Checklist
N/A