{"repo":"samchungy/fastify-zod-openapi","free":true,"listed":false,"github":"https://github.com/samchungy/fastify-zod-openapi","clone":"git clone https://github.com/samchungy/fastify-zod-openapi.git","description":"Fastify plugin for zod-openapi","language":"TypeScript","stars":122,"topics":["fastify","fastify-plugin","openapi","zod","typescript"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"fastify-zod-openapi Fastify type provider , validation, serialization and @fastify/swagger support for zod-openapi . Install Install via npm , pnpm or pnpm : Usage Usage with plugins Usage with @fastify/swagger Declaring Components This library allows you to easily declare components. As an example: Wherever title is used in your request/response schemas across your application, it will instead be created as a reference. For a further dive please follow the documentation here. If you wish to declare the components manually you will need to do so via the plugin's options. You will also need to create a custom SerializerCompiler to make use of fast-json-stringify. Alternatively, you can use JSON.stringify instead. By default, this library assumes that if a response schema provided is not a Zod Schema, it is a JSON Schema and will naively pass it straight into fast-json-stringify . This will not work in conjunction with Fastify's schema registration. If you have other routes with response schemas which are not Zod Schemas, you can supply a fallbackSerializer to createSerializerCompiler . Please note: the parameters components do not appear to be supported by the @fastify/swagger library. Create Document Options If you wish to use CreateDocumentOptions, pass it in via the plugin options: Custom Response Serializer The default response serializer serializerCompiler uses fast-json-stringify. Under the hood, the schema passed to the response is transformed using OpenAPI 3.1.0 and pa","default_branch":null,"files":null,"tree":[],"storefront":"/r/samchungy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/samchungy/fastify-zod-openapi/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}