Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonatard/proto-to-postman
proto-to-postman is a command line tool to create postman API import collection from .proto.
https://github.com/sonatard/proto-to-postman
Last synced: 2 days ago
JSON representation
proto-to-postman is a command line tool to create postman API import collection from .proto.
- Host: GitHub
- URL: https://github.com/sonatard/proto-to-postman
- Owner: sonatard
- Created: 2019-04-08T14:40:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-19T01:13:11.000Z (over 4 years ago)
- Last Synced: 2024-08-04T04:05:52.241Z (3 months ago)
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 25
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-grpc - proto-to-postman - Create postman API import collection from .proto files (Tools / CLI)
README
# proto-to-postman
proto-to-postman is a command line tool to create postman API import collection from `.proto`.
## Install
```console
go get -u github.com/sonatard/proto-to-postman
```## Usage
```console
proto-to-postman \
-n xxx-api \
-b "https://exmaple.com/" \
-h "Content-Type:application/json,Accept:application/json" \
-i proto/ \
api/v1/*.proto
```## Support proto file format
### google.api.http annotation
Possible to create multi APIs `{URL}/{AnnotationValue}`.
```proto
import "google/api/annotations.proto";service UserService {
rpc GetUser(GetUserRequest) returns (GetUserResponse){
option (google.api.http) = {
post: "/UserService/GetUser"
body: "user"
additional_bindings {
post: "/UserService/GetUser2"
body: "*"
}
additional_bindings {
get: "/UserService/GetUser"
}
};
};
}message GetUserRequest {
User user = 1;
}message GetUserResponse {}
message User {
string user_id= 1;
string user_name = 2;
}
```google.api.http spec is here.
https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#google.api.HttpRule
## Limitation
- Only supported for Postman v2.1.0 scheme