Skip to content

core: support Integer and Long in service configuration parsing#12827

Open
kannanjgithub wants to merge 1 commit into
grpc:masterfrom
kannanjgithub:service-config-parser-integer
Open

core: support Integer and Long in service configuration parsing#12827
kannanjgithub wants to merge 1 commit into
grpc:masterfrom
kannanjgithub:service-config-parser-integer

Conversation

@kannanjgithub
Copy link
Copy Markdown
Contributor

Previously, ManagedChannelImplBuilder and JsonUtil only supported Double or String for numeric values in service configurations. This caused IllegalArgumentException when using service configurations produced by JSON parsers like Jackson that represent non-decimal numbers as Integer or Long.

This change:

  • Updates ManagedChannelImplBuilder to accept any Number type.
  • Enhances JsonUtil to robustly handle numeric conversions while maintaining necessary integral checks.
  • Adds ServiceConfigNumericTypeTest to verify support for Integer, Double, and Long types.

Fixes #12815

Previously, ManagedChannelImplBuilder and JsonUtil only supported Double
or String for numeric values in service configurations. This caused
IllegalArgumentException when using service configurations produced by
JSON parsers like Jackson that represent non-decimal numbers as
Integer or Long.

This change:
 - Updates ManagedChannelImplBuilder to accept any Number type.
 - Enhances JsonUtil to robustly handle numeric conversions while
   maintaining necessary integral checks.
 - Adds ServiceConfigNumericTypeTest to verify support for Integer,
   Double, and Long types.

Fixes grpc#12815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service Configuration containing Integer values abort with IllegalArgumentException

1 participant