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

SqladminV1beta4 client returns an incorrect object if passed nil in get() #699

Closed
Temikus opened this issue Jul 22, 2018 · 1 comment
Closed
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@Temikus
Copy link

Temikus commented Jul 22, 2018

Observe:
service is client instance here

service.get_instance(nil).to_h
=> #<Google::Apis::SqladminV1beta4::DatabaseInstance:0x00007ff731389c00 @kind="sql#instancesList">

if instance exist:

service.get_instance("real_instance").to_h
=> #<Google::Apis::SqladminV1beta4::DatabaseInstance:0x00007ff731490108
 @backend_type="SECOND_GEN",
...

if instance doesn't exist:

service.get_instance("not_real_instance").to_h
Google::Apis::ClientError: instanceDoesNotExist: The Cloud SQL instance does not exist.

EXPECTED RESULT:
Passing in nil should return either nil or an error.

ACTUAL RESULT:
Passing in nil returns an invalid empty object.

Somewhat related to #698, however, the behaviour is slightly different and API is different so submitting this separately. Feel free to dedup.

@JustinBeckwith JustinBeckwith added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jul 22, 2018
@TheRoyalTnetennba TheRoyalTnetennba added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Aug 6, 2018
@JustinBeckwith JustinBeckwith removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Aug 6, 2018
@bajajneha27 bajajneha27 self-assigned this Jan 24, 2024
@bajajneha27
Copy link
Contributor

Hi @Temikus,
Thank you for bringing this to our attention! It does seem like there might be an opportunity to have better validation on the service backend for empty input scenarios since client-side validations aren't our typical approach.
You'll have to raise a bug report directly with the SQLAdmin service team. They will be best positioned to investigate this issue and implement potential fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants