Releases: go-fuego/fuego
v0.17.0: 🎄 Experimental Gin support
v0.17 Highlights 🔥
Merry Christmas! 🎄 And thank you to my little sister that was the 1000th star of this repo ❤️
Experimental Gin support
We're happy to tell you that Fuego now supports Gin router !!!
For the moment, only a subset of Fuego's features are enabled (OpenAPI mostly). We don't have plugged validation, transformation... yet, but this will be available on the next release in January. For the moment, don't hesitate to play with this module and raise issues if you spot a bug.
Middlewares
Are now explicited and declared in the spec! Middlewares were often described in Go as opaque, magic and error-prone. Not with Fuego: they cannot hide anymore!
OpenAPI Responses
With option.DefaultStatusCode
, you can change the default status code for the happy path.
And with AddResponse
, you can declare your custom "non-happy-path" responses! You can also easily declare responses of the pure net/http
controllers if you're using these instead of Fuego controllers. Can be a first step towards type safety while keeping flexibility while migrating, for example.
BREAKING: if you were using AddError
, switch to AddResponse
please!
BREAKING: Context update
We're changing Fuego's signature from "generic type constrained by interface" to an interface. Now, you can more easily stub it in your tests!
Simply replace *fuego.ContextNoBody
by fuego.ContextNoBody
and *fuego.ContextWithBody
by fuego.ContextWithBody
Automatically make all required changes:
For macOS (BSD sed):
find . -type f -exec sed -i '' 's/\*fuego\.ContextNoBody/fuego\.ContextNoBody/g; s/\*fuego\.ContextWithBody/fuego\.ContextWithBody/g' {} +
For Linux (GNU sed):
find . -type f -exec sed -i 's/\*fuego\.ContextNoBody/fuego\.ContextNoBody/g; s/\*fuego\.ContextWithBody/fuego\.ContextWithBody/g' {} +
What's Changed
- Adds a direct reference to the OpenAPI object in the BaseRoute object by @EwenQuim in #271
- refactor: set openapi server url as close to startup as possible by @dylanhitt in #273
- feat: AddResponse by @dylanhitt in #274
- chore: cleanup some status codes and godoc by @dylanhitt in #277
- Description option : override + default description contains the list of middlewares by @EwenQuim in #275
- Refactor, mutualize and document Route object by @EwenQuim in #279
- Cli/add service generation by @rizerkrof in #256
- BREAKING: update WithGlobalResponseType to take by @dylanhitt in #276
- Set status code before returning when no data by @EwenQuim in #282
- Removes unused generator field from the Server struct by @EwenQuim in #283
- BREAKING CHANGE: Remove pointer from ContextNoBody and ContextWithBody, use interface directly in handlers by @EwenQuim in #286
- chore: remove previously deprecated WithPort by @dylanhitt in #289
- Mutualise a part of Context between net/http and gin by @EwenQuim in #288
- Moved all non-net/http related code to the new Engine struct by @EwenQuim in #290
- chore: change RunTLS test to use require.Eventually/httptest by @dylanhitt in #292
- Optionshow by @dylanhitt in #291
- chore: comment Deprecatd -> OptionDeprecated by @dylanhitt in #295
- Updated all dependencies and requires Go 1.23 by @EwenQuim in #301
- Generic main handler by @EwenQuim in #300
- Gin compat by @EwenQuim in #260
Full Changelog: v0.16.2...v0.17.0
v0.16.2: More options, Error with detail, preparing for gin compatibility
What's Changed
- Splits the auto 200 response declaration and response body into two separate steps by @EwenQuim in #257
- feat: add ErrorWithDetail by @dylanhitt in #228
- Default status code by @EwenQuim in #259
- feat: Prevents empty tags from being added to routes by @EwenQuim in #261
- Sets response headers in the OpenAPI spec by @EwenQuim in #258
- chore(deps): bump the npm_and_yarn group across 1 directory with 16 updates by @dependabot in #268
- Decorrelates openapi registration from server by @EwenQuim in #262
- Added Security Policy by @EwenQuim in #269
New Contributors
- @dependabot made their first contribution in #268
Full Changelog: v0.16.1...v0.16.2
v0.16.1: Composable Options everywhere!
Thanks to all the contributors for this release! 🙏🏼 It happens only a month after the previous one, we'll try to keep up with this rythm, with more frequent and smaller updates -except this one which is a big one anyway!
Main features 🔥
Composable options everywhere - not only on Routes but also on Server and on Groups. Don't forget that you can always create you own reusable & composable options with the latest v0.15.0 release, you're never stuck with Fuego!
Security Schemes declared on Server and available on a per-route option, with start-time checks, tahnk you @simonemastella for this one!
BREAKING: if you use a custom error that doesn't implement the ErrorWithStatus
interface, you will not use RFC 9457, but your custom error types. We still recommend using RFC 9457 and if you're using fuego-provided errors or the ErrorWithStatus
interface, nothing has changed for you. Thanks @dylanhitt for this one!
What's Changed
- chore: change files names to validate_params to follow repo structure by @dylanhitt in #246
- Adds Path parameter declaration with start-time safety checks by @EwenQuim in #250
- Declare custom 200 response by @EwenQuim in #251
- Example: generate an image with custom title for Opengraph (demo of custom response + path param) by @EwenQuim in #252
- BREAKING: only respond with HTTPError on proper type match by @dylanhitt in #234
- added securityScheme by @simonemastella in #226
- Remove deprecated params by @EwenQuim in #254
- Refactor route option inheritance by @EwenQuim in #255
New Contributors
- @simonemastella made their first contribution in #226
Full Changelog: v0.15.1...v0.16.1
v0.15.0: Variadic options
Main feature : variadic options pattern 🔥
This pattern has been in test for the last months and is now confirmed. We fixed a lot of bugs, and it should be stable now. If not, don't hesitate to raise an issue!
The new syntax is described here : #174.
Thank you @rizerkrof @dylanhitt @ccoVeille @redecs for being regular contributors, and also thanks to the newcomers!
What's Changed
- chore: add test for multidimensional array bodies by @dylanhitt in #152
- feat: add ability to disable just the swagger ui by @dylanhitt in #155
- Tests/golden 2d array by @dylanhitt in #158
- Uses operation provided in register by @EwenQuim in #157
- chore: petstore tests cleanup by @dylanhitt in #160
- chore: fix comment typos in deserialization.go by @dylanhitt in #161
- BREAKING: all default Send* and Send*Error functions to have the same… by @dylanhitt in #164
- Fixing EOF bad request error when consume a route with empty request body by @dhanielsales in #168
- chore: ensure we test EOF clause in read by @dylanhitt in #170
- Enhance query parameters to support a list of parameters by @dhanielsales in #169
- chore: add test for SendHTML and minor test cleanup by @dylanhitt in #171
- feat: add group parameters by @rizerkrof in #165
- feat: add route.RequestContentType by @dylanhitt in #177
- Fix (potential) typo in the word resources by @asahasrabuddhe in #179
- Chore/send default by @dylanhitt in #175
- Correctly log status code by @MaikelH in #181
- Fix package name for Generated Controllers by @asahasrabuddhe in #178
- sort go imports by @ccoVeille in #186
- typos suggestion by @ccoVeille in #187
- feature: Add a CI for detecting typos by @imransolanki in #189
- ci: add a spellchecker to GitHub CI by @ccoVeille in #190
- Variadic route options by @EwenQuim in #176
- Hide route from OpenAPI spec, variadic options way by @EwenQuim in #196
- ci: no func whitespace by @dylanhitt in #205
- fixed wrong schema generation when using embedded struct by @mrguamos in #206
- docs: remove ErrorHandler doc reference to removed
ErrorWithInfo
in… by @dylanhitt in #212 - feat: add WithRequestContentType config option for the Server by @dylanhitt in #204
- Better Accept Serialization by @EwenQuim in #200
- Fix data race due to global instance of openapi3gen.Generator by @loikg in #202
- 500 internal server error by @EwenQuim in #213
- fix: gourmet app admin recipe creation by @dylanhitt in #214
- Moved Options & Params to main package by @EwenQuim in #215
- Enhance/admin searchs by @dylanhitt in #216
- Feat/param.required by @dylanhitt in #217
- Perf/url.values by @dylanhitt in #220
- refactor(basic-example) by @dylanhitt in #229
- Chore/refactor examples by @dylanhitt in #231
New Contributors
- @dhanielsales made their first contribution in #168
- @asahasrabuddhe made their first contribution in #179
- @MaikelH made their first contribution in #181
- @ccoVeille made their first contribution in #186
- @imransolanki made their first contribution in #189
- @mrguamos made their first contribution in #206
- @loikg made their first contribution in #202
Full Changelog: v0.14.0...v0.15.0
v0.14.0: Going stronger ⚙️
v0.14 : Going stronger ⚙️
v0.14 was a lot of hard work for us maintainers, but a lot of new features are coming to Fuego. 🔥
Fuego's has been tested through an intensive test suite and also in prod last few months, with great success at my company! I think we can say we are production-ready.
I wanted to thank the maintainers team for everything, thank you all!
Feature highlights
- OpenAPI generation is now more complete accurate
- We added a lot of internal tests and fixed bugs
- We have the long-awaited multi-return feature (will describe this in a blog post)
- Validation annotations are now understood for generating the OpenAPI schema
- Errors can be declared globally to register standard 400, 401... errors
- Errors can be declared on a per-route basis
What's Changed
- Struct-Based route Registration by @EwenQuim in #93
- chore: deprecation notice for WithPort() by @dylanhitt in #110
- Read Binary body with application/octet-stream Content-Type header by @EwenQuim in #112
- docs: remove usage of WithPort from docs in favor of WithAddr by @dylanhitt in #114
- Default tags are based on groups + possibility to disable auto tags by @EwenQuim in #115
- FIX: middlewares guides typo by @dvordrova in #117
- ci: add golangci-lint by @dylanhitt in #116
- Feat/disable print openapi by @dylanhitt in #123
- chore: typo on TestWithoutStartupMessages test by @dylanhitt in #124
- Easier TLS setup by @redecs in #120
- Chore/server setup by @dylanhitt in #126
- ACME Server TLS example with Let's Encrypt and certmagic by @redecs in #125
- Ci/markdown lint by @dylanhitt in #138
- deps: bump gorilla/scheme to v1.4.1 by @dylanhitt in #139
- fix: revert back to the simple funcName style operationID by @dylanhitt in #135
- Zuplo sponsoring by @EwenQuim in #140
- Update Zuplo sponsorship by @AdrianMachado in #142
- chore: add justification for disabled markdownlint rules by @dylanhitt in #144
- fix: differentiate between array types and standard structs by @dylanhitt in #134
- OpenAPI default description is a Fuego Cheatsheet by @EwenQuim in #149
- Extras in their own module by @EwenQuim in #147
- Golden file testing by @EwenQuim in #148
- Multi return by @EwenQuim in #137
- Info fields by @EwenQuim in #151
- Errors can be declared globally and route per route by @EwenQuim in #150
Breaking changes
- Your OpenAPI will be changed significantly (but for the better, we pass a lot of linters and tests)
- Markdown package has been moved to its own module
github.com/go-fuego/fuego/extra/markdown
New Contributors
- @dvordrova made their first contribution in #117
- @redecs made their first contribution in #120
- @AdrianMachado made their first contribution in #142
Full Changelog: v0.13.4...v0.14.0
v0.13.0: Errors & Tags
Features highlights 🔥
- RFC 9457 is implemented : Fuego now uses the standard way to handle errors in an API!
- Groups Tags : only add a tag
Book
once for all your/books/*
routes! - Hide routes and groups from OpenAPI Spec (useful for HTML routes for example)
- decode YAML input
(net/http) *Server
is now an embedded field, making Fuego even closed from the standard library
What's Changed
- feat: add swagger ui handler in server by @rizerkrof in #57
- fix: Set body height to 100% of the viewport height by @mailbaoer in #58
- feat: add option for custom validator by @vladz in #65
- cors handling by @EwenQuim in #68
- feat: support decoding x-yaml content-type in ContextWithBody by @dylanhitt in #72
- docs: ContextWithBody clarification by @dylanhitt in #73
- Sets
WithAddr
option and pass int asWithPort
argument by @EwenQuim in #74 - Embed
(net/http) *Server
field in fuego Server by @EwenQuim in #75 - Exposes OutputOpenAPISpec method to generate directly the outputs without starting server by @EwenQuim in #77
- Hide group by @EwenQuim in #78
- Make Default OpenAPI handler public by @EwenQuim in #83
- Adds Cookie and Header methods to context by @EwenQuim in #84
- RFC 9457 implementation by @EwenQuim in #86
- Basic auth test by @EwenQuim in #88
- Adds coverage tracking to repository by @EwenQuim in #90
- Fixes error Content-Type by @EwenQuim in #89
- feat: add tags to the Server (i.e Group) level by @dylanhitt in #91
New Contributors
- @mailbaoer made their first contribution in #58
- @vladz made their first contribution in #65
Full Changelog: v0.12.0...v0.13.0
v0.12.0
Features
Fuego now uses an online OpenAPI UI by default. This make the binaries built with Fuego 10Mb lighter, with the drawback to not be able to use the OpenAPI UI when offline. You can activate offline OpenAPI UI (embedded in the binary) with the build tag openapi_ui_local
, see docs.
Making the binary size smaller was planned, but the idea of using StopLight Elements for the online UI was given to me by @danielgtaylor in his project Huma, a project similar to Fuego.
What's Changed
- Update ci/cd go version to 1.22 by @Kronopt in #52
- docs: adds custom serialization guide by @EwenQuim in #54
- OpenAPI UI : online (now the default) or embedded (optional build tag) by @EwenQuim in #55
- docs: fix text in link to LICENSE.txt by @qbit in #53
New Contributors
Full Changelog: v0.11.0...v0.12.0
v0.11.0
New Features 🔥
- Cookie OpenAPI param
fuego.Get(s, "/test", testController).
Cookie("my-cookie", "my description")
- Header OpenAPI param
fuego.Get(s, "/test", testController).
Header("my-header", "my description")
What's Changed
- feat: add generate controller cli by @rizerkrof in #39
- docs: add fuego social platforms by @hugoleborso in #41
- Add search to documentation & minor cleanup by @Jeremie-Chauvel in #42
- Fix video size on documentation home page by @Jeremie-Chauvel in #43
- Improve Doc homepage responsiveness for mobile by @Jeremie-Chauvel in #44
- Change to MIT license by @hugoleborso in #47
- Doc: Fix usage of
Use
for middleware example by @guerinoni in #50 - feature: add header and cookie to openapi schema by @kaazedev in #48
- renamed AddHeader, AddCookie, WithQueryParams to Header, Cookie, QueryParam by @EwenQuim in #51
Breaking Changes
The breaking changes are (and will always be) explicit (no silent breaking changes) and easy to change until Fuego hits 1.0
- renamed WithDescription to Description
- renamed WithSummary to Summary
- renamed WithQueryParam to QueryParam
- renamed SetDeprecated to Deprecated
New Contributors
- @Jeremie-Chauvel made their first contribution in #42
- @guerinoni made their first contribution in #50
- @kaazedev made their first contribution in #48
Full Changelog: v0.10.0...v0.11.0
v0.10.0
What's Changed
Features
- Supports context in InTransformer by @EwenQuim in #33
- Templ & Gomponents first class support by @EwenQuim in b90fb6b
- Use different contexts by @EwenQuim in #36
Fixes
Other
- Docusaurus Docs by @hugoleborso in #34
- Docs/init docusaurus by @hugoleborso in #35
- Demo : use templ by @EwenQuim in b53b591
- Improved test coverage by @EwenQuim in 2165a2b
- Adds tests to CI by @EwenQuim in 79ad952
Full Changelog: v0.9.0...v0.10.0
v0.8.0 The "Fuego" release 🔥
What's Changed
- Add per route middlewares by @rizerkrof in #28
- HTML Rendering by @EwenQuim in #29
- Renamed Op to Fuego everywhere by @EwenQuim in 0a56b23
- Markdown support by @EwenQuim in 121af76
- Group mux does not accepts trailing slashesby @EwenQuim in a20613a
- Pass any context from a controller to a
Ctx[any]
controller by @EwenQuim in 2fe3a13 - QueryParamInt/Bool methods by @EwenQuim in bfe4fd5
- Validation should return 400 on fail by @rizerkrof in #30
Full Changelog: v0.7.0...v0.8.0