Fix ObjectSerializer to preserve baseName-keyed fields during serialize - #1
Merged
Merged
Conversation
…alize Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
brendandburns
August 19, 2026 16:36
View session
brendandburns
marked this pull request as ready for review
August 19, 2026 19:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the fix from kubernetes-client/javascript#3016:
ObjectSerializer.serializealways read source values viadata[attributeType.name](the TS property name), silently dropping values when input data is keyed by the APIbaseNameinstead — e.g. raw/parsed data containingx-kubernetes-preserve-unknown-fields.Templates
modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache— used bytypescript,typescript-fetch,typescript-axios,typescript-rxjs, and related generators.modules/openapi-generator/src/main/resources/typescript-node/models.mustache— used by the legacytypescript-nodegenerator.Generated samples/fixtures
samples/and the integration test fixture undermodules/openapi-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expectedto match the template change../bin/generate-samples.shrequires a Maven build (./mvnw ... clean package) and the sandbox lacked network access to fetch Maven/dependencies. The resulting diffs mirror what the updated templates would produce.