@tsed/schema 8.25.1 → 8.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,10 +19,12 @@ function alterMerge(_, obj) {
19
19
  * @ignore
20
20
  */
21
21
  export function inheritedClassMapper(obj, { target, ...options }) {
22
- const stores = Array.from(getInheritedStores(target).entries()).filter(([model]) => classOf(model) !== classOf(target));
22
+ const stores = Array.from(getInheritedStores(target).entries())
23
+ .filter(([model]) => classOf(model) !== classOf(target))
24
+ .reverse();
23
25
  if (stores.length) {
24
26
  const schema = stores.reduce((obj, [, store]) => {
25
- return deepMerge(obj, execMapper("schema", [store.schema], options), { alter: alterMerge });
27
+ return deepMerge(obj, execMapper("schema", [store.schema], { ...options, inheritedClass: store.target }), { alter: alterMerge });
26
28
  }, {});
27
29
  return deepMerge(schema, obj, { alter: alterMerge });
28
30
  }
@@ -83,7 +83,7 @@ function mapKeys(schema, options) {
83
83
  }
84
84
  function serializeSchema(schema, options) {
85
85
  let obj = mapKeys(schema, options);
86
- if (schema.isClass && !schema.isLocalSchema) {
86
+ if (options.inheritedClass !== schema.class && schema.isClass && !schema.isLocalSchema) {
87
87
  obj = execMapper("inheritedClass", [obj], {
88
88
  ...options,
89
89
  root: false,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tsed/schema",
3
3
  "description": "JsonSchema module for Ts.ED Framework",
4
4
  "type": "module",
5
- "version": "8.25.1",
5
+ "version": "8.25.2",
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
@@ -34,7 +34,7 @@
34
34
  "tsed"
35
35
  ],
36
36
  "dependencies": {
37
- "@tsed/openspec": "8.25.1",
37
+ "@tsed/openspec": "8.25.2",
38
38
  "change-case": "^5.4.4",
39
39
  "json-schema": "0.4.0",
40
40
  "picomatch": "4.0.2",
@@ -43,11 +43,11 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@apidevtools/swagger-parser": "10.1.0",
46
- "@tsed/barrels": "8.25.1",
47
- "@tsed/core": "8.25.1",
48
- "@tsed/hooks": "8.25.1",
49
- "@tsed/openspec": "8.25.1",
50
- "@tsed/typescript": "8.25.1",
46
+ "@tsed/barrels": "8.25.2",
47
+ "@tsed/core": "8.25.2",
48
+ "@tsed/hooks": "8.25.2",
49
+ "@tsed/openspec": "8.25.2",
50
+ "@tsed/typescript": "8.25.2",
51
51
  "@types/fs-extra": "11.0.4",
52
52
  "@types/json-schema": "7.0.15",
53
53
  "@types/picomatch": "3.0.2",