Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
aac7e58
Revert generated
Jleagle Oct 22, 2022
a2d3029
Add to cmd
Jleagle Oct 23, 2022
6804a3b
Add to codegen
Jleagle Oct 23, 2022
e98165b
Fiber
Jleagle Oct 23, 2022
4b511df
Fix imports
Jleagle Oct 24, 2022
9723041
Templates
Jleagle Oct 24, 2022
95bac95
Split types and code
Jleagle Oct 24, 2022
cd77c32
Rename aliases
Jleagle Oct 25, 2022
d973a93
Strict
Jleagle Oct 25, 2022
8ae6349
tests
Jleagle Oct 27, 2022
1419716
Validate middleware
Jleagle Oct 27, 2022
abe8eca
Templates
Jleagle Oct 27, 2022
a8ea994
Update petstore
Jleagle Oct 28, 2022
3d2d00d
Generate
Jleagle Oct 28, 2022
6f95691
Generate
Jleagle Oct 29, 2022
1485238
Readme
Jleagle Oct 29, 2022
3e9d535
Fix tests
Jleagle Oct 29, 2022
49ca45e
Fix build
Jleagle Dec 19, 2022
25e93e7
tweaks to get it running
gnirb Feb 10, 2023
daaeb2c
fixed linter errors, even though other servers seem to just ignore these
gnirb Feb 10, 2023
8f3997c
Fix option yaml
Jleagle Feb 16, 2023
e60601b
Fix tests
Jleagle Feb 17, 2023
fde3a7b
Mod tidy
Jleagle Feb 21, 2023
83b391d
Remove extra space
Jleagle Mar 4, 2023
9b7f95e
Check errors
Jleagle Mar 4, 2023
0579a04
Update pkg/fiber-middleware/oapi_validate_test.go
Jleagle Mar 4, 2023
9950d5f
Update pkg/fiber-middleware/oapi_validate_test.go
Jleagle Mar 5, 2023
72f97a0
Update pkg/fiber-middleware/oapi_validate_test.go
Jleagle Mar 5, 2023
f7374b7
Update pkg/fiber-middleware/oapi_validate_test.go
Jleagle Mar 5, 2023
532ee1d
Update pkg/fiber-middleware/oapi_validate_test.go
Jleagle Mar 5, 2023
75cf747
Separate oapi-codegen imports
Jleagle Apr 10, 2023
84953e7
Use t.Helper()
Jleagle Apr 11, 2023
fab7a48
fixing comments
gnirb Apr 11, 2023
4030fff
Sort imports
Jleagle May 14, 2023
25b5227
Use WriteString
Jleagle May 14, 2023
6198c7f
Fix imports
Jleagle May 14, 2023
5d342cb
Mods
Jleagle May 14, 2023
dfafdc4
Generate
Jleagle May 14, 2023
22089bf
Add missing config
Jleagle May 14, 2023
c58882a
Use new adaptor
Jleagle May 27, 2023
c6e3a43
Use new adaptor
Jleagle May 27, 2023
6f1ff00
Merge remote-tracking branch 'upstream/master'
Jleagle Jun 2, 2023
91094f6
Merge remote-tracking branch 'origin/master' into fiber
Jun 2, 2023
88e1309
Merge remote-tracking branch 'origin/master' into fiber
Jun 2, 2023
7fc79c6
Fix compilation and test issues
Jun 2, 2023
b890a90
Merge pull request #31 from deepmap/updates-to-813
Jleagle Jun 2, 2023
4f5751f
Merge branch 'deepmap:master' into master
Jleagle Jun 2, 2023
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
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ you can focus on implementing the business logic for your service.

We have chosen to focus on [Echo](https://github.com/labstack/echo) as
our default HTTP routing engine, due to its speed and simplicity for the generated
stubs, and [Chi](https://github.com/go-chi/chi), [Gin](https://github.com/gin-gonic/gin),
and [gorilla/mux](https://github.com/gorilla/mux) have also been added by
contributors as additional routers. We chose Echo because the `Context` object
is a mockable interface, and it allows for some advanced testing.
stubs. [Chi](https://github.com/go-chi/chi), [Gin](https://github.com/gin-gonic/gin),
[gorilla/mux](https://github.com/gorilla/mux), and [Fiber](https://github.com/gofiber/fiber)
have also been added by contributors as additional routers. We chose Echo because
the `Context` object is a mockable interface, and it allows for some advanced
testing.

This package tries to be too simple rather than too generic, so we've made some
design decisions in favor of simplicity, knowing that we can't generate strongly
Expand Down Expand Up @@ -700,6 +701,8 @@ you can specify any combination of those.
same package to compile.
- `chi-server`: generate the Chi server boilerplate. This code is dependent on
that produced by the `types` target.
- `fiber`: generate the Fiber server boilerplate. This code is dependent
on that produced by the `types` target.
- `client`: generate the client boilerplate. It, too, requires the types to be
present in its package.
- `spec`: embed the OpenAPI spec into the generated code as a gzipped blob.
Expand Down
6 changes: 4 additions & 2 deletions cmd/oapi-codegen/oapi-codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,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", "gorilla", "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", "fiber".`)
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 @@ -293,7 +293,7 @@ func loadTemplateOverrides(templatesDir string) (map[string]string, error) {
for _, f := range files {
// Recursively load subdirectory files, using the path relative to the templates
// directory as the key. This allows for overriding the files in the service-specific
// directories (e.g. echo, chi, etc.).
// directories (e.g. echo, chi, fiber, etc.).
if f.IsDir() {
subFiles, err := loadTemplateOverrides(path.Join(templatesDir, f.Name()))
if err != nil {
Expand Down Expand Up @@ -445,6 +445,8 @@ func generationTargets(cfg *codegen.Configuration, targets []string) error {
switch opt {
case "chi-server", "chi":
opts.ChiServer = true
case "fiber-server", "fiber":
opts.FiberServer = true
case "server", "echo-server", "echo":
opts.EchoServer = true
case "gin", "gin-server":
Expand Down
246 changes: 246 additions & 0 deletions examples/petstore-expanded/fiber/api/petstore-server.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions examples/petstore-expanded/fiber/api/petstore-types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading