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
1
Versions
430
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-zod-api - npm Package Versions

1
4143

1.3.0

Diff

Changelog

Source

v1.3.0

  • Zod version is 3.2.0.
  • Minor changes to logging internal server errors.
robintail
published 1.2.1 •

Changelog

Source

v1.2.1

  • Additional handling of keys in Routing objects.
  • createServer, attachRouting and new OpenAPI() may throw an Error in case of using slashes in Routing keys.
robintail
published 1.2.0 •

Changelog

Source

v1.2.0

  • Ability to specify the endpoint description and export it to the Swagger / OpenAPI specification:
    • The feature suggested by @glitch452.
// example
const endpoint = endpointsFactory.build({
  description: "Here is an example description of the endpoint",
  // ...,
});
  • Ability to specify either methods or method property to .build(). This is just a more convenient way for a single method case.
// example
const endpoint = endpointsFactory.build({
  method: "get", // same as methods:['get'] before
  // ...,
});
  • Ability for a route to have multiple Endpoints attached depending on different methods. It can also be the same Endpoint that handle multiple methods as well. This is a solution for the question raised in issue #29.
// example of different I/O schemas for /v1/user
const routing: Routing = {
  v1: {
    user: new DependsOnMethod({
      get: myEndpointForGetAndDelete,
      delete: myEndpointForGetAndDelete,
      post: myEndpointForPostAndPatch,
      patch: myEndpointForPostAndPatch,
    }),
  },
};
robintail
published 1.1.0 •

Changelog

Source

v1.1.0

  • Zod version is v3.1.0.
robintail
published 1.0.0 •

Changelog

Source

v1.0.0

  • First version based on the stable Zod release.
  • Zod version is v3.0.2.
  • Other dependencies has been upgraded to the latest versions as well.

Version 0

robintail
published 0.7.2 •

Changelog

Source

v0.7.2

  • Readme file updates:
    • Transformations
    • ResultHandler
    • better examples
robintail
published 0.7.1 •

Changelog

Source

v0.7.1

  • Readme file updates:
    • Concept description update.
    • Excess property check according to the new features of version 0.7.0.
  • Refactoring of defaultResultHandler and ResultHandler calls in server.ts.
robintail
published 0.7.0 •

Changelog

Source

v0.7.0

  • Zod version is v3.0.0-beta.1.
  • Ability to use z.ZodIntersection and z.ZodUnion as an I/O schema for handlers and middlewares.
// example
const middleware = createMiddleware({
  input: z
    .object({
      one: z.string(),
    })
    .or(
      z.object({
        two: z.number(),
      }),
    ),
  middleware: async ({ input }) => ({
    input, // => type: { one: string } | { two: number }
  }),
});
  • Ability to use z.transform() in handler's output schema.
// example
const endpoint = factory.build({
  methods: ["post"],
  input: z.object({}),
  output: z.object({
    value: z.string().transform((str) => str.length),
  }),
  handler: async ({ input, options }) => ({
    value: "test", // => in response: { value: 4 }
  }),
});
  • Supplying parameters to EndpointsFactory::constructor() is now prohibited. Please use .addMiddleware() and .setResultHandler() as the right way in order to achieve the correct input schema type in handlers.
robintail
published 0.6.1 •

Changelog

Source

v0.6.1

  • Nothing special. Just new logo and the dataflow diagram update.
robintail
published 0.6.0 •

Changelog

Source

v0.6.0

  • OpenAPI / Swagger specification generator now supports ZodNullable, ZodOptional, ZodUnion and ZodIntersection properties.
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