You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
This is `sebuf`, a specialized Go protobuf toolkit for building HTTP APIs. It consists of two complementary protoc plugins that together enable modern, type-safe API development:
7
+
This is `sebuf`, a specialized Go protobuf toolkit for building HTTP APIs. It consists of three complementary protoc plugins that together enable modern, type-safe API development:
8
8
9
9
-**`protoc-gen-go-http`**: Generates HTTP handlers, routing, request/response binding, and automatic validation
10
+
-**`protoc-gen-go-client`**: Generates type-safe HTTP clients with functional options pattern
The toolkit enables developers to build HTTP APIs directly from protobuf definitions without gRPC dependencies, targeting web and mobile API development with built-in request validation.
@@ -17,19 +18,22 @@ The project follows a clean Go protoc plugin architecture with separated concern
17
18
18
19
### Plugin Structure
19
20
-**cmd/protoc-gen-go-http/**: HTTP handler generator entry point
21
+
-**cmd/protoc-gen-go-client/**: HTTP client generator entry point
20
22
-**cmd/protoc-gen-openapiv3/**: OpenAPI specification generator entry point
21
23
-**internal/httpgen/**: HTTP handler generation logic, annotations, and header validation middleware
24
+
-**internal/clientgen/**: HTTP client generation logic and annotations
22
25
-**internal/openapiv3/**: OpenAPI generation logic, type mapping, and header parameter generation
23
26
-**proto/sebuf/http/**: HTTP annotation definitions including headers.proto for header validation
24
27
-**scripts/**: Test automation and build scripts
25
28
26
29
### Core Components
27
30
28
31
1.**HTTP Handler Generator** (`internal/httpgen/generator.go:22`): Generates HTTP handlers, request binding, routing configuration, automatic body validation, and header validation middleware
29
-
2.**OpenAPI Generator** (`internal/openapiv3/generator.go:53`): Creates comprehensive OpenAPI v3.1 specifications from protobuf definitions with full header parameter support, generating one file per service for better organization
30
-
3.**HTTP Annotations** (`proto/sebuf/http/annotations.proto`): Custom protobuf extensions for HTTP configuration
31
-
4.**Header Validation** (`proto/sebuf/http/headers.proto`): Protobuf definitions for service and method-level header validation
32
-
5.**Validation System**: Automatic request body validation via buf.validate/protovalidate and header validation middleware
32
+
2.**HTTP Client Generator** (`internal/clientgen/generator.go:13`): Generates type-safe HTTP clients with functional options pattern, automatic request/response marshaling, and error handling
33
+
3.**OpenAPI Generator** (`internal/openapiv3/generator.go:53`): Creates comprehensive OpenAPI v3.1 specifications from protobuf definitions with full header parameter support, generating one file per service for better organization
34
+
4.**HTTP Annotations** (`proto/sebuf/http/annotations.proto`): Custom protobuf extensions for HTTP configuration
35
+
5.**Header Validation** (`proto/sebuf/http/headers.proto`): Protobuf definitions for service and method-level header validation
36
+
6.**Validation System**: Automatic request body validation via buf.validate/protovalidate and header validation middleware
33
37
34
38
### Generated Output Examples
35
39
@@ -44,6 +48,27 @@ type UserServiceServer interface {
0 commit comments