Title: Ability to provide type hints to non-identifier keys · Issue #871 · cel-expr/cel-java · GitHub
Open Graph Title: Ability to provide type hints to non-identifier keys · Issue #871 · cel-expr/cel-java
X Title: Ability to provide type hints to non-identifier keys · Issue #871 · cel-expr/cel-java
Description: Consider a JSON object { "with-hyphen": "a-string", "$startsWithDollarSign": 123 } Problem: It's not possible to provide type-hints for with-hyphen and $startsWithDolalrSign CEL can get type information well if we can express an object a...
Open Graph Description: Consider a JSON object { "with-hyphen": "a-string", "$startsWithDollarSign": 123 } Problem: It's not possible to provide type-hints for with-hyphen and $startsWithDolalrSign CEL can get type inform...
X Description: Consider a JSON object { "with-hyphen": "a-string", "$startsWithDollarSign": 123 } Problem: It's not possible to provide type-hints for with-hyphen and $startsWith...
Opengraph URL: https://github.com/cel-expr/cel-java/issues/871
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ability to provide type hints to non-identifier keys","articleBody":"Consider a JSON object\n\n```json\n{ \n \"with-hyphen\": \"a-string\", \n \"$startsWithDollarSign\": 123\n}\n```\n\n**Problem**: It's not possible to provide type-hints for `with-hyphen` and `$startsWithDolalrSign` \n\nCEL can get type information well if we can express an object as protobuf, or use `StructType`. However, there are times when we have objects that have non-identifier keys. \n\nRight now, it's not possible to provide typesafety for non-identifier keys.\n\nIt would be amazing if we could.\n\n**Alternatives considered**\n\nTo solve this for ourselves, we considered to hacks:\n1. Use aliases: walk the CEL tree, and rename all non-identifer keys to some known identifer-style key.\n2. Run our own compile step validation: walk the cel tree, and do the type checking ourselves. \n\nRight now we are going with 2., but if there was some built-in way to specify types for keys from index access, it would be amazing.\n","author":{"url":"https://github.com/stopachka","@type":"Person","name":"stopachka"},"datePublished":"2025-11-21T19:10:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/871/cel-java/issues/871"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e1f726cc-a665-4a40-d884-1a5e9baa3b00 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2A4:35FB06:DFFD44:133CDF4:6A4DD097 |
| html-safe-nonce | bae58bfd41220693c052ffecead6319989d7e7181844adc0586f1c9eb843d556 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkE0OjM1RkIwNjpERkZENDQ6MTMzQ0RGNDo2QTRERDA5NyIsInZpc2l0b3JfaWQiOiI1ODg0NDE4NTEwODcyNzYwNDcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8e678c7e7feca1441bad68cd2900690a31285194562f68c515b50fc7bb76cad7 |
| hovercard-subject-tag | issue:3652799440 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cel-expr/cel-java/871/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ad09b5b2b53a1675e46ccb9ab94422d24df4d8ee69dd70f024406d8358c52ec2/cel-expr/cel-java/issues/871 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ad09b5b2b53a1675e46ccb9ab94422d24df4d8ee69dd70f024406d8358c52ec2/cel-expr/cel-java/issues/871 |
| og:image:alt | Consider a JSON object { "with-hyphen": "a-string", "$startsWithDollarSign": 123 } Problem: It's not possible to provide type-hints for with-hyphen and $startsWithDolalrSign CEL can get type inform... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stopachka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/cel-expr/cel-java git https://github.com/cel-expr/cel-java.git |
| octolytics-dimension-user_id | 186625994 |
| octolytics-dimension-user_login | cel-expr |
| octolytics-dimension-repository_id | 587078119 |
| octolytics-dimension-repository_nwo | cel-expr/cel-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587078119 |
| octolytics-dimension-repository_network_root_nwo | cel-expr/cel-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width