[ruby-nextgen] Fix enumUnknownDefaultCase mapping and numeric enum constant casing (#24996) #25344
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 359 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.352
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #25344"
general
weight: 0.35
princejain756
Fixes #24996
When
enumUnknownDefaultCase=trueis enabled forruby-nextgen:1.
RubyNextgenClientCodegen#toEnumVarNamepreviously skipped.toUpperCase(Locale.ROOT)in the numeric (Integer/Float) branch, emittingunknown_default_open_api = 11184809in lowercase (which Ruby evaluates as a local variable instead of a constant, raisingNameErrorinself.all).2.
partial_model_enum_class.mustachedid not defineself.build(value), soPolymorphism.coerce_modelnever mapped unknown values toUNKNOWN_DEFAULT_OPEN_API.Changes
varNamein the numeric branch ofRubyNextgenClientCodegen#toEnumVarName.self.build(value)inpartial_model_enum_class.mustachewhenenumUnknownDefaultCaseis enabled.RubyNextgenClientCodegenTest.PR checklist
ruby-nextgen(bin/configs/ruby-nextgen.yaml,bin/configs/ruby-nextgen-qdrant.yaml) do not enableenumUnknownDefaultCaseand are unaffected.<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Fixes #24996. When
enumUnknownDefaultCase=true, the generatedruby-nextgenclient emitted numeric enum members likeunknown_default_open_api = 11184809in lowercase, which Ruby treats as a local variable instead of a constant and raisesNameErrorinself.all. Unknown values also never mapped toUNKNOWN_DEFAULT_OPEN_APIbecauseself.build(value)was missing.partial_model_enum_class.mustachenow emitsself.build(value)whenenumUnknownDefaultCaseis enabled, mapping unknown values to the unknown default member and passingnilthrough unchanged.connection.mustachedeserializes arrays of enums throughbuildso unknown members in array responses map correctly, and skips array handling when the payload is not an array.<sup>Written for commit 698c83f0f7a6ec1259ff6d0b73f82ba44bc7a98f. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/OpenAPITools/openapi-generator/pull/25344?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->