@rvoh/psychic 0.37.0-beta.6 → 0.37.0-beta.7

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.
@@ -308,14 +308,9 @@ function associationOpenapi(attribute, DataTypeForOpenapi, alreadyExtractedDesce
308
308
  throw new ObjectSerializerRendersOneAndManyRequireClassType_js_1.default(attribute.name);
309
309
  throw new ObjectSerializerRendersOneAndManyRequireClassType_js_1.default(attribute.name);
310
310
  }
311
- if (associatedClass?.isDream) {
312
- associatedClasses = (0, dream_1.expandStiClasses)(associatedClass);
313
- }
314
- else {
315
- associatedClasses = [associatedClass];
316
- }
311
+ associatedClasses = [associatedClass];
317
312
  }
318
- const serializers = associatedClasses.flatMap(associatedClass => (0, dream_1.inferSerializersFromDreamClassOrViewModelClass)(associatedClass, attribute.options.serializerKey));
313
+ const serializers = (0, dream_1.uniq)(associatedClasses.flatMap(associatedClass => (0, dream_1.inferSerializersFromDreamClassOrViewModelClass)(associatedClass, attribute.options.serializerKey)));
319
314
  if (serializers.length === 0)
320
315
  throw new NoSerializerFoundForRendersOneAndMany_js_1.default(attribute.name);
321
316
  if (serializers.length === 1) {
@@ -339,7 +334,7 @@ function associationOpenapi(attribute, DataTypeForOpenapi, alreadyExtractedDesce
339
334
  ...serializers.flatMap(serializer => descendantSerializers(serializer, alreadyExtractedDescendantSerializers)),
340
335
  ],
341
336
  openapi: {
342
- anyOf: (0, dream_1.sortBy)((0, dream_1.uniq)(serializers.map(serializer => new SerializerOpenapiRenderer(serializer).serializerRef), ref => ref['$ref']), ref => (ref['$ref'] ? ref['$ref'] : (0, node_util_1.inspect)(ref, { depth: 2 }))),
337
+ anyOf: (0, dream_1.sortBy)(serializers.map(serializer => new SerializerOpenapiRenderer(serializer).serializerRef), ref => (ref['$ref'] ? ref['$ref'] : (0, node_util_1.inspect)(ref, { depth: 2 }))),
343
338
  },
344
339
  },
345
340
  };
@@ -302,14 +302,9 @@ function associationOpenapi(attribute, DataTypeForOpenapi, alreadyExtractedDesce
302
302
  throw new ObjectSerializerRendersOneAndManyRequireClassType(attribute.name);
303
303
  throw new ObjectSerializerRendersOneAndManyRequireClassType(attribute.name);
304
304
  }
305
- if (associatedClass?.isDream) {
306
- associatedClasses = expandStiClasses(associatedClass);
307
- }
308
- else {
309
- associatedClasses = [associatedClass];
310
- }
305
+ associatedClasses = [associatedClass];
311
306
  }
312
- const serializers = associatedClasses.flatMap(associatedClass => inferSerializersFromDreamClassOrViewModelClass(associatedClass, attribute.options.serializerKey));
307
+ const serializers = uniq(associatedClasses.flatMap(associatedClass => inferSerializersFromDreamClassOrViewModelClass(associatedClass, attribute.options.serializerKey)));
313
308
  if (serializers.length === 0)
314
309
  throw new NoSerializerFoundForRendersOneAndMany(attribute.name);
315
310
  if (serializers.length === 1) {
@@ -333,7 +328,7 @@ function associationOpenapi(attribute, DataTypeForOpenapi, alreadyExtractedDesce
333
328
  ...serializers.flatMap(serializer => descendantSerializers(serializer, alreadyExtractedDescendantSerializers)),
334
329
  ],
335
330
  openapi: {
336
- anyOf: sortBy(uniq(serializers.map(serializer => new SerializerOpenapiRenderer(serializer).serializerRef), ref => ref['$ref']), ref => (ref['$ref'] ? ref['$ref'] : inspect(ref, { depth: 2 }))),
331
+ anyOf: sortBy(serializers.map(serializer => new SerializerOpenapiRenderer(serializer).serializerRef), ref => (ref['$ref'] ? ref['$ref'] : inspect(ref, { depth: 2 }))),
337
332
  },
338
333
  },
339
334
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "name": "@rvoh/psychic",
4
4
  "description": "Typescript web framework",
5
- "version": "0.37.0-beta.6",
5
+ "version": "0.37.0-beta.7",
6
6
  "author": "RVOHealth",
7
7
  "repository": {
8
8
  "type": "git",
@@ -58,7 +58,7 @@
58
58
  "devDependencies": {
59
59
  "@eslint/js": "^9.19.0",
60
60
  "@jest-mock/express": "^3.0.0",
61
- "@rvoh/dream": "^0.43.0-beta.9",
61
+ "@rvoh/dream": "^0.43.0-beta.10",
62
62
  "@rvoh/dream-spec-helpers": "^0.2.4",
63
63
  "@rvoh/psychic-spec-helpers": "^0.6.0",
64
64
  "@types/express": "^5.0.1",