---
title: "Discussion on \"Typed API Contracts from NestJS to Next.js with OpenAPI: openapi-typescript, openapi-fetch, and Where the Types Lie — Field Notes 693ab1\" | Hashnode"
description: "Discussion on \"Typed API Contracts from NestJS to Next.js with OpenAPI: openapi-typescript, openapi-fetch, and Where the Types Lie — Field Notes 693ab1\". Headline: The most reliable way I have found to keep a Next.js frontend in sync with a NestJS REST API is to treat the OpenAPI spec as the contract: the @nestjs/swagger CLI plugin generates the spec a"
url: "https://hashnode.com/posts/typed-api-contracts-from-nestjs-to-next-js-with-openapi-openapi-typescript-openapi-fetch-and-where-the-types-lie-field-notes-693ab1/6b0a7ccc28c62bebd9ee832c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Typed API Contracts from NestJS to Next.js with OpenAPI: openapi-typescript, openapi-fetch, and Where the Types Lie — Field Notes 693ab1](https://engahmed.hashnode.dev/typed-api-contracts-from-nestjs-to-next-js-with-openapi-openapi-typescript-openapi-fetch-and-where-the-types-lie-field-notes-693ab1?utm_source=hashnode&utm_medium=feed)

Headline: The most reliable way I have found to keep a Next.js frontend in sync with a NestJS REST API is to treat the OpenAPI spec as the contract: the @nestjs/swagger CLI plugin generates the spec a

3d ago · 10 min read · engahmed.hashnode.dev  
Read the article

## Written by

[Ahmed Mahmoud](https://hashnode.com/@ahmed-mahmoud)

@ahmed-mahmoud

  
[View profile](https://hashnode.com/@ahmed-mahmoud)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
