New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More ā†’
Socket
Sign inDemoInstall
Socket

express-zod-api

Package Overview
Dependencies
Maintainers
0
Versions
429
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-zod-api - npm Package Versions

23
ā€¦
43

22.9.0

Diff

Changelog

Source

v22.9.0

  • Featuring Deprecations:
    • You can deprecate all usage of an Endpoint using EndpointsFactory::build({ deprecated: true });
    • You can deprecate a route using the assigned Endpoint::deprecated() or DependsOnMethod::deprecated();
    • You can deprecate a schema using ZodType::deprecated();
    • All .deprecated() methods are immutable ā€” they create a new copy of the subject;
    • Deprecated schemas and endpoints are reflected in the generated Documentation and Integration;
    • The feature suggested by @mlms13.
import { Routing, DependsOnMethod } from "express-zod-api";
import { z } from "zod";

const someEndpoint = factory.build({
  deprecated: true, // deprecates all routes the endpoint assigned to
  input: z.object({
    prop: z.string().deprecated(), // deprecates the property or a path parameter
  }),
});

const routing: Routing = {
  v1: oldEndpoint.deprecated(), // deprecates the /v1 path
  v2: new DependsOnMethod({ get: oldEndpoint }).deprecated(), // deprecates the /v2 path
  v3: someEndpoint, // the path is assigned with initially deprecated endpoint (also deprecated)
};
robintail
published 22.8.0 ā€¢

robintail
published 22.7.0 ā€¢

Changelog

Source

v22.7.0

  • Technical release in connection with the implementation of workspaces into the project architecture.
robintail
published 22.7.0-beta.0 ā€¢

robintail
published 22.6.0 ā€¢

Changelog

Source

v22.6.0

  • Feature: pulling examples up from the object schema properties:
    • When describing I/O schemas for generating Documentation the examples used to work properly only when assigned to the top level (z.object().example()), especially complex scenarios involving path parameters and middlewares;
    • This version supports examples assigned to the individual properties on the I/O object schemas;
    • It makes the syntax more readable and fixes the issue when example is only set for a path parameter.
const before = factory.build({
  input: z
    .object({
      key: z.string(),
    })
    .example({
      key: "1234-5678-90",
    }),
});

const after = factory.build({
  input: z.object({
    key: z.string().example("1234-5678-90"),
  }),
});
robintail
published 22.5.0 ā€¢

Changelog

Source

v22.5.0

  • Feature: defaultResultHandler sets headers from HttpError:
    • If you throw createHttpError(400, "message", { headers }) those headers go to the negative response.
  • Feature: Ability to respond with status code 405 (Method not allowed) to requests having wrong method:
    • Previously, in all cases where the method and route combination was not defined, the response had status code 404;
    • For situations where a known route does not support the method being used, there is a more appropriate code 405:
      • See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 for details;
    • You can activate this feature by setting the new wrongMethodBehavior config option 405 (default: 404).
import { createConfig } from "express-zod-api";

createConfig({ wrongMethodBehavior: 405 });
robintail
published 22.4.2 ā€¢

Changelog

Source

v22.4.2

  • Excluded 41 response-only headers from the list of well-known ones used to depict request params in Documentation.
robintail
published 21.11.3 ā€¢

robintail
published 20.22.2 ā€¢

robintail
published 22.4.1 ā€¢

Changelog

Source

v22.4.1

  • Fixed a bug that could lead to duplicate properties in generated client types:
    • If the middleware and/or endpoint schemas had the same property, it was duplicated by Integration.
    • The issue was introduced in v20.15.3 and reported by @bobgubko.
// reproduction
factory
  .addMiddleware({
    input: z.object({ query: z.string() }), // ...
  })
  .build({
    input: z.object({ query: z.string() }), // ...
  });
type Before = {
  query: string;
  query: string; // <ā€” bug #2352
};
type After = {
  query: string;
};
23
ā€¦
43
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc