Skip to content

Commit 1ea0eee

Browse files
committed
[housekeeping] docs
1 parent 2ad7ac1 commit 1ea0eee

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Influenced by some of the ideas behind [restish](https://rest.sh/) it uses the f
3636
- more of the OpenAPI types and their checks. eg arrays, enums, objects, multi types etc
3737
- type checking request bodies of certain MIME types eg, `application/json`
3838
- better handling of request bodies eg, providing a stdin or a curl like notation for a file `@payload.json` etc.
39+
- more CLI libs?
3940

4041
### Installation
4142

@@ -102,10 +103,10 @@ This can be used to query the params from the command mostly in a type safe mann
102103
// to get all the int path params
103104
for _, param := range data.PathParams {
104105
if param.Type == climate.Integer {
105-
// Cobra
106+
// Cobra
106107
value, _ := opts.Flags().GetInt(param.Name)
107108

108-
// urfave/cli
109+
// urfave/cli
109110
value, _ := opts.Int(param.Name)
110111
}
111112
}
@@ -114,7 +115,16 @@ for _, param := range data.PathParams {
114115
Define the handlers for the necessary operations. These map to the `operationId` field of each operation:
115116

116117
```go
117-
handlers := map[string]Handler{
118+
// Cobra
119+
handlers := map[string]HandlerCobra{
120+
"AddGet": handler,
121+
"AddPost": handler,
122+
"HealthCheck": handler,
123+
"GetInfo": handler,
124+
}
125+
126+
// urfave/cli
127+
handlers := map[string]HandlerUrfaveCli{
118128
"AddGet": handler,
119129
"AddPost": handler,
120130
"HealthCheck": handler,
@@ -144,7 +154,7 @@ rootCmd.Execute()
144154
rootCmd.Run(context.TODO(), os.Args)
145155
```
146156

147-
Sample output:
157+
Sample output using Cobra:
148158

149159
```
150160
$ go run main.go --help

0 commit comments

Comments
 (0)