Skip to content

Commit 09f567b

Browse files
committed
refactor(node-app): sort properties
1 parent cfb9bf0 commit 09f567b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.changeset/upset-planes-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@dreamkit/node-app": patch
3+
---
4+
5+
Sort schema properties

packages/node-app/src/NodeSettingsHandler.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@ export class NodeSettingsHandler extends SettingsHandlerClass({
7676
} as Record<string, any>,
7777
};
7878

79+
const properties: Record<string, any> = {};
80+
7981
for (const value of this.settings) {
8082
const options = value.options;
8183
if (!options.optional) schema.required.push(options.name!);
82-
schema.properties[options.name!] = (
83-
options.params as ObjectType
84-
).toJsonSchema();
84+
properties[options.name!] = (options.params as ObjectType).toJsonSchema();
85+
}
86+
87+
schema.required.sort();
88+
89+
for (const name of Object.keys(properties).sort()) {
90+
schema.properties[name] = properties[name];
8591
}
8692

8793
return schema;

0 commit comments

Comments
 (0)