Skip to content

Commit

Permalink
fix(stackbit): order of inlined fields
Browse files Browse the repository at this point in the history
  • Loading branch information
julrich committed Jul 9, 2024
1 parent 1d0f03a commit 2b0f3f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@kickstartds/jsonschema2stackbit",
"comment": "fix order of inlined fields",
"type": "patch"
}
],
"packageName": "@kickstartds/jsonschema2stackbit"
}
2 changes: 1 addition & 1 deletion tools/jsonschema2stackbit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function convert({
schema.fields.length > 0 &&
Array.isArray(parent)
) {
for (const field of schema.fields) {
for (const field of schema.fields.reverse()) {
parent.unshift({
...field,
name: `${value.name}__${field.name}`,
Expand Down

0 comments on commit 2b0f3f7

Please sign in to comment.