Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ func SetupHandler() {
http.Handle("/", Handler(&myApi))
}
```

Alternatively, [Gorilla](https://github.com/gorilla/mux) is also 100% compatible with `net/http` and can be generated with `-generate gorilla`.

</summary></details>

#### Additional Properties in type definitions
Expand Down
4 changes: 3 additions & 1 deletion cmd/oapi-codegen/oapi-codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func main() {
// All flags below are deprecated, and will be removed in a future release. Please do not
// update their behavior.
flag.StringVar(&flagGenerate, "generate", "types,client,server,spec",
`Comma-separated list of code to generate; valid options: "types", "client", "chi-server", "server", "gin", "spec", "skip-fmt", "skip-prune"`)
`Comma-separated list of code to generate; valid options: "types", "client", "chi-server", "server", "gin", "gorilla", "spec", "skip-fmt", "skip-prune"`)
flag.StringVar(&flagIncludeTags, "include-tags", "", "Only include operations with the given tags. Comma-separated list of tags.")
flag.StringVar(&flagExcludeTags, "exclude-tags", "", "Exclude operations that are tagged with the given tags. Comma-separated list of tags.")
flag.StringVar(&flagTemplatesDir, "templates", "", "Path to directory containing user templates")
Expand Down Expand Up @@ -321,6 +321,8 @@ func newConfigFromOldConfig(c oldConfiguration) configuration {
opts.Generate.EchoServer = true
case "gin":
opts.Generate.GinServer = true
case "gorilla":
opts.Generate.GorillaServer = true
case "types":
opts.Generate.Models = true
case "spec":
Expand Down
6 changes: 6 additions & 0 deletions examples/petstore-expanded/gorilla/api/cfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package: api
generate:
gorilla-server: true
models: true
embedded-spec: true
output: petstore.gen.go
Loading