<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv" -->

---
title: Protobuf, JSON Schema, and OpenAPI · Buf | daily.dev
description: Protobuf schemas can be turned into JSON Schema and OpenAPI documents using two plugins: Buf's protoc-gen-jsonschema and the community-maintained...
canonical: https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Protobuf, JSON Schema, and OpenAPI · Buf | daily.dev
og:description: Protobuf schemas can be turned into JSON Schema and OpenAPI documents using two plugins: Buf's protoc-gen-jsonschema and the community-maintained...
og:url: https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv
og:image: https://api.daily.dev/og/posts/00wGYENFv.png
og:image:alt: Protobuf, JSON Schema, and OpenAPI · Buf
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Protobuf, JSON Schema, and OpenAPI · Buf

**[Buf Blog](https://daily.dev/sources/buf)** · 6 min read · 7 upvotes · 0 comments

## Summary

Protobuf schemas can be turned into JSON Schema and OpenAPI documents using two plugins: Buf's protoc-gen-jsonschema and the community-maintained protoc-gen-connect-openapi. The piece walks through an example inventory service with Protovalidate rules, showing how validation constraints translate into JSON Schema fields like minLength, maxLength, and pattern, and how Connect RPCs map to OpenAPI 3.1 paths and schemas. It covers practical uses (IDE autocomplete, payload validation, constraining LLM structured output, generating docs sites and clients) and three ways to run the plugins: as a local Go-installed plugin, as a remote BSR plugin, or by downloading a pre-generated SDK archive from the BSR.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://buf.build/blog/protobuf-json-schema-and-openapi>

## Questions this post answers

### How do I generate JSON Schema from a Protobuf schema?

Use the protoc-gen-jsonschema plugin from Buf's protoschema-plugins, which produces JSON Schema draft 2020-12 definitions for Protobuf messages. It converts Protovalidate rules like min_len and max_len into minLength and maxLength, and regex constraints into pattern. By default it writes several file variants depending on Protobuf vs JSON field names, inlining vs separate files, and whether alternate representations are allowed.

_daily.dev surfaces workflow write-ups like this for teams wiring schema validation into their API pipelines._

### How do I generate an OpenAPI spec from a Connect RPC service defined in Protobuf?

Use protoc-gen-connect-openapi, a community plugin that generates an OpenAPI 3.1 document describing each Connect endpoint as an HTTP POST with a JSON body, including related types and error schemas. It can merge a handwritten OpenAPI file for details like server URLs and auth schemes, and it respects google/gnostic annotations for keeping those settings in the proto file itself.

_developers choosing between proto-first and OpenAPI-first workflows can track this kind of tooling comparison on daily.dev._

### What are the different ways to run Buf code generation plugins like protoc-gen-jsonschema?

There are three options: install the plugin locally via go install and run it through buf generate with buf.gen.yaml; run it as a remote plugin hosted on the BSR by specifying 'remote' instead of 'local' so nothing needs to be installed locally; or download a pre-generated SDK archive directly from a URL for a module already published to the BSR, avoiding the Buf CLI entirely.

_CI pipeline maintainers evaluating schema-generation setups can find setup breakdowns like this on daily.dev._

## Similar posts on daily.dev

- [The modern Protobuf workflow · Buf](https://daily.dev/posts/the-modern-protobuf-workflow-buf-c2m7gywhe) · Buf Blog · 1 upvotes · 0 comments
- [Better than JSON](https://daily.dev/posts/better-than-json-d2je9kyed) · Hacker News · 250 upvotes · 22 comments
- [Google Protocol Buffers flaw turns schemas into shells](https://daily.dev/posts/google-protocol-buffers-flaw-turns-schemas-into-shells-ssmnskxpa) · CSO Online · 8 upvotes · 0 comments
- [Protobuf-ES just got a lot faster · Buf](https://daily.dev/posts/protobuf-es-just-got-a-lot-faster-buf-rcovndatq) · Buf Blog · 18 upvotes · 1 comments
- [A modern alternative to Protocol Buffer](https://daily.dev/posts/a-modern-alternative-to-protocol-buffer-k1dw3nil7) · Hacker News · 28 upvotes · 3 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#backend](https://daily.dev/tags/backend), [#openapi](https://daily.dev/tags/openapi)

[View this post on daily.dev](https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Protobuf, JSON Schema, and OpenAPI · Buf","url":"https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv"},"datePublished":"2026-09-22T13:16:54.257Z","dateModified":"2026-09-22T13:32:56.943Z","description":"Protobuf schemas can be turned into JSON Schema and OpenAPI documents using two plugins: Buf's protoc-gen-jsonschema and the community-maintained...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f91dd70b01f7a545a25c23517481e5cf?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f91dd70b01f7a545a25c23517481e5cf?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Buf Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Buf Blog","logo":"https://media.daily.dev/image/upload/s--2YBgo_Nm--/f_auto,q_auto/v1787469605/logos/buf?_a=BAMAMicg0","url":"https://daily.dev/sources/buf"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,backend,openapi","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Buf Blog","item":"https://daily.dev/sources/buf"},{"@type":"ListItem","position":3,"name":"Protobuf, JSON Schema, and OpenAPI · Buf"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/protobuf-json-schema-and-openapi-buf-00wgyenfv#faq","mainEntity":[{"@type":"Question","name":"How do I generate JSON Schema from a Protobuf schema?","acceptedAnswer":{"@type":"Answer","text":"Use the protoc-gen-jsonschema plugin from Buf's protoschema-plugins, which produces JSON Schema draft 2020-12 definitions for Protobuf messages. It converts Protovalidate rules like min_len and max_len into minLength and maxLength, and regex constraints into pattern. By default it writes several file variants depending on Protobuf vs JSON field names, inlining vs separate files, and whether alternate representations are allowed. daily.dev surfaces workflow write-ups like this for teams wiring schema validation into their API pipelines."}},{"@type":"Question","name":"How do I generate an OpenAPI spec from a Connect RPC service defined in Protobuf?","acceptedAnswer":{"@type":"Answer","text":"Use protoc-gen-connect-openapi, a community plugin that generates an OpenAPI 3.1 document describing each Connect endpoint as an HTTP POST with a JSON body, including related types and error schemas. It can merge a handwritten OpenAPI file for details like server URLs and auth schemes, and it respects google/gnostic annotations for keeping those settings in the proto file itself. developers choosing between proto-first and OpenAPI-first workflows can track this kind of tooling comparison on daily.dev."}},{"@type":"Question","name":"What are the different ways to run Buf code generation plugins like protoc-gen-jsonschema?","acceptedAnswer":{"@type":"Answer","text":"There are three options: install the plugin locally via go install and run it through buf generate with buf.gen.yaml; run it as a remote plugin hosted on the BSR by specifying 'remote' instead of 'local' so nothing needs to be installed locally; or download a pre-generated SDK archive directly from a URL for a module already published to the BSR, avoiding the Buf CLI entirely. CI pipeline maintainers evaluating schema-generation setups can find setup breakdowns like this on daily.dev."}}]}
```

