@tsed/schema 6.73.1 → 6.73.5

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.
@@ -1,5 +1,5 @@
1
1
  import { constantCase, pascalCase, camelCase } from 'change-case';
2
- import { Store, decoratorTypeOf, nameOf, isFunction, cleanObject, isPromise, isClass, isSymbol, isPrimitiveOrPrimitiveClass, isClassObject, isDate, isCollection, classOf, isArrowFn, primitiveOf, isArray, Hooks, uniq, isObject, uniqBy, deepMerge, toMap, Entity, DecoratorTypes, descriptorOf, Metadata, isPrimitiveClass, ancestorsOf, mergeReducerBuilder, UnsupportedDecoratorType, decorateMethodsOf, isString, isPlainObject, isNumber, useDecorators, StoreSet } from '@tsed/core';
2
+ import { Store, decoratorTypeOf, nameOf, isFunction, cleanObject, isPromise, isClass, isSymbol, isPrimitiveOrPrimitiveClass, isClassObject, isDate, isCollection, classOf, isArrowFn, primitiveOf, isArray, Hooks, uniq, isObject, uniqBy, deepMerge, toMap, Entity, DecoratorTypes, descriptorOf, Metadata, isPlainObject, isPrimitiveClass, ancestorsOf, mergeReducerBuilder, UnsupportedDecoratorType, decorateMethodsOf, isString, isNumber, useDecorators, StoreSet } from '@tsed/core';
3
3
  import micromatch from 'micromatch';
4
4
 
5
5
  const HTTP_STATUS_MESSAGES = {
@@ -2163,10 +2163,10 @@ class JsonEntityStore extends Entity {
2163
2163
  return this.from(target, propertyKey, descriptorOf(target, propertyKey));
2164
2164
  }
2165
2165
 
2166
- getResponseOptions(contentType = "application/json") {
2166
+ getResponseOptions(status, contentType = "application/json") {
2167
2167
  var _this$operation, _this$operation$getRe;
2168
2168
 
2169
- const media = (_this$operation = this.operation) == null ? void 0 : (_this$operation$getRe = _this$operation.getResponseOf(this.statusCode)) == null ? void 0 : _this$operation$getRe.getMedia(contentType, false);
2169
+ const media = (_this$operation = this.operation) == null ? void 0 : (_this$operation$getRe = _this$operation.getResponseOf(status)) == null ? void 0 : _this$operation$getRe.getMedia(contentType, false);
2170
2170
 
2171
2171
  if (media && media.has("schema")) {
2172
2172
  const schema = media.get("schema");
@@ -2217,7 +2217,11 @@ class JsonEntityStore extends Entity {
2217
2217
  if (isCollection(type)) {
2218
2218
  this.collectionType = type;
2219
2219
  } else {
2220
- this._type = type;
2220
+ this._type = type; // issue #1534: Enum metadata stored as plain object instead of String (see: https://github.com/tsedio/tsed/issues/1534)
2221
+
2222
+ if (this._type && isPlainObject(this._type)) {
2223
+ this._type = String;
2224
+ }
2221
2225
  }
2222
2226
  }
2223
2227
 
@@ -7312,10 +7316,6 @@ function Name(name) {
7312
7316
  store.parameter.name(name);
7313
7317
  break;
7314
7318
 
7315
- case DecoratorTypes.METHOD:
7316
- store.operation.name(name);
7317
- break;
7318
-
7319
7319
  default:
7320
7320
  store.parent.schema.addAlias(args[1], name);
7321
7321
  }