Repository navigation
fix: keep array index keys in default order with objectMechanism 'native' - #941
Open
yuyongyan29-dev wants to merge 2 commits into
Open
yuyongyan29-dev wants to merge 2 commits into
yuyongyan29-dev wants to merge 2 commits into
Conversation
…ive'
The default codegen writes required properties first. With 'native' the
values go through an object, and an object always lists array index keys
(such as "2") first, so a required "a" next to an optional "2" came out
as {"2":...,"a":...} instead of {"a":...,"2":...}.
Leave such schemas to the default codegen.
Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
mcollina
requested review from
Tony133 and
gurgunday
and removed request for
Tony133
November 27, 2026 14:47
Member
|
I resolved the conflict with I reproduced the problem on |
This branch has not been deployed
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.
With
objectMechanism: 'native', a required property next to an array index key comes out in a different order than the default codegen:The scratch object always lists index keys first. Such schemas now fall back to the default codegen.
npm run lintandnpm testpass (100% coverage, Node 24 and 26)