zod-nest 3.2.4 → 3.2.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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { isZodDto, ZodNestError, ZodValidationException, defaultRegistry, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, flattenObjectIntersection, resolveSchemaRef, isZodObject, registerSchema, expandObjectSchema, paramSchemaBody, COMPONENTS_SCHEMAS_PREFIX, isZodSchema, buildToJsonSchemaOptions, resolveAnonId, ANON_RESPONSE_PREFIX, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION } from './chunk-2NVNXIOY.mjs';
2
- export { COMPONENTS_SCHEMAS_PREFIX, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZodNestError, ZodNestUnrepresentableError, ZodValidationException, createRegistry, defaultRegistry, extend, getLineage, isZodDto, isZodSchema, registerSchema, toOpenApi } from './chunk-2NVNXIOY.mjs';
1
+ import { isZodDto, ZodNestError, ZodValidationException, defaultRegistry, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, flattenObjectIntersection, resolveSchemaRef, isZodObject, registerSchema, expandObjectSchema, paramSchemaBody, COMPONENTS_SCHEMAS_PREFIX, isZodSchema, buildToJsonSchemaOptions, resolveAnonId, ANON_RESPONSE_PREFIX, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION } from './chunk-YRTGPVSJ.mjs';
2
+ export { COMPONENTS_SCHEMAS_PREFIX, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZodNestError, ZodNestUnrepresentableError, ZodValidationException, createRegistry, defaultRegistry, extend, getLineage, isZodDto, isZodSchema, registerSchema, toOpenApi } from './chunk-YRTGPVSJ.mjs';
3
3
  import { singleton, __name } from './chunk-MPNAA53V.mjs';
4
4
  export { overrideJSONSchema } from './chunk-MPNAA53V.mjs';
5
5
  import { InternalServerErrorException, HttpStatus, Injectable, Optional, Inject, Logger, RequestMethod, applyDecorators } from '@nestjs/common';
@@ -769,12 +769,17 @@ var ZodBody = /* @__PURE__ */ __name((schema, options) => {
769
769
  });
770
770
  }, "ZodBody");
771
771
  var resolveBodySchema = /* @__PURE__ */ __name((schema, options) => {
772
+ const registry = options?.registry ?? defaultRegistry;
772
773
  if (options?.flatten === true) {
773
- return flattenObjectIntersection(schema, options.registry ?? defaultRegistry, "@ZodBody");
774
+ const merged = flattenObjectIntersection(schema, registry, "@ZodBody");
775
+ return resolveSchemaRef(merged, {
776
+ registry,
777
+ deferAnonInline: true
778
+ }).ref;
774
779
  }
775
780
  return resolveSchemaRef(schema, {
776
781
  id: options?.id,
777
- registry: options?.registry,
782
+ registry,
778
783
  deferAnonInline: true
779
784
  }).ref;
780
785
  }, "resolveBodySchema");