Releases: rhyek/nestjs-endpoints
2.0.3
Bug fixes
-
Middleware that added response headers after controller execution were failing with
Cannot set headers after they are sent to the client.This was fixed, however nestjs-endpoints can no longer support endpoint output schemas that are nullable. NestJS does not send
nullwhen using Express.js. More info.So instead of:
endpoint({ output: personSchema.nullable(), ... });
now do:
endpoint({ output: z.object({ person: personSchema.nullable() }), ... })
2.0.2
Bug fixes
-
Middleware that added response headers after controller execution were failing with
Cannot set headers after they are sent to the client.This was fixed, however nestjs-endpoints can no longer support endpoint output schemas that are nullable. NestJS does not send
nullwhen using Express.js. More info.So instead of:
endpoint({ output: personSchema.nullable(), ... });
now do:
endpoint({ output: z.object({ person: personSchema.nullable() }), ... })
2.0.1
Minor changes
- Deprecated
injectAtRequestin favor ofinjectOnRequest
2.0.0
Breaking Changes
- Upgraded to Zod v4: Zod v3 schemas will have to be upgraded to v4.
- Upgraded to zod-openapi v5: See the v5 migration guide if you used
.openapi()extensions. - OpenAPI version upgrade: Now generates OpenAPI 3.1.1 schemas (previously 3.0.0).
Minor changes
- Deprecated
injectMethodparameter in favor ofinjectAtRequestfor clarity.
1.5.1
Testing
- Added more tests
1.5.0
Features
- Replaced
nestjs-zodwith zod-openapi. The main benefit is output schemas will now emit OpenApi schemas and consequently TypeScript definitions for endpoint payloads that considerZodEffects.
Example:
const schema = z.object({
age: z.number().default(30),
});The above schema when used in input will still mark age as optional, but when used in output it will not.
type ExampleInput = {
age?: number;
};
type ExampleOutput = {
age: number;
};1.4.0
Features
- Provide
rawInputto handlers with input schemas. This is the request body parsed by NestJS, but before zod.
1.3.1
Bugfixes
- Support OPTIONS HTTP method
- Use my fork of @nestjs/zod until this is merged: BenLorantfy/nestjs-zod#151
1.3.0
1.2.1
readme