google-auth-library-java icon indicating copy to clipboard operation
google-auth-library-java copied to clipboard

Handle optional fields with null JSON value gracefully

Open clementdenis opened this issue 10 months ago • 3 comments

This PR handles correctly JSON null values for optional fields in ExternalAccountCredentials configuration.

This is likely a partial fix, other credential classes have the same issue (just search for (String) json.get( in the codebase).

The approach might applied to all json fields, including required ones, to avoid ClassCastException and have better errors.

Fixes #1705 ☕️

clementdenis avatar Mar 10 '25 14:03 clementdenis

For the PR, can you update title to use convention commits? I think can just add a fix: ... prefix to the title.

Also, I think the linter CI is failing. Can you run mvn fmt:format on this change?

lqiu96 avatar Mar 11 '25 19:03 lqiu96

Adding @aeitzman for review on 3pi code.

lqiu96 avatar Mar 11 '25 20:03 lqiu96

Adding a different reviewer as there have been some changes.

lqiu96 avatar Mar 28 '25 18:03 lqiu96