Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ledongthuc authored Jan 16, 2023
1 parent 58a8e7d commit 23b62b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions go/jsonschema_from_proto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ Generate json schema from proto file.

https://developers.google.com/protocol-buffers/docs/downloads

2. Install
2. Install protoc lib & tag inject binary

```
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install github.com/favadi/protoc-go-inject-tag@latest
```

3. Generate proto files
```protoc -I=./proto_files --go_out=./ ./proto_files/student.proto ./proto_files/class.proto```

```
protoc -I=./proto_files --go_out=./ ./proto_files/student.proto ./proto_files/class.proto
```

4. Inject json schema to proto files
```protoc-go-inject-tag -input="./app/pro/*.pb.go"```

```
protoc-go-inject-tag -input="./app/pro/*.pb.go"
```

5. Generate json schema
```go
Expand Down

0 comments on commit 23b62b2

Please sign in to comment.