Skip to content

Releases: go-fuego/fuego

v0.17.0: 🎄 Experimental Gin support

24 Dec 02:29
c93b8d1
Compare
Choose a tag to compare

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!

image

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

13 Dec 19:01
e7fde33
Compare
Choose a tag to compare

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

Full Changelog: v0.16.1...v0.16.2

v0.16.1: Composable Options everywhere!

06 Dec 19:05
Compare
Choose a tag to compare

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

Full Changelog: v0.15.1...v0.16.1

v0.15.0: Variadic options

21 Nov 12:44
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v0.14.0...v0.15.0

v0.14.0: Going stronger ⚙️

23 Jul 07:48
Compare
Choose a tag to compare

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!

image

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

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

Full Changelog: v0.13.4...v0.14.0

v0.13.0: Errors & Tags

21 Mar 21:30
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v0.12.0...v0.13.0

v0.12.0

26 Feb 18:32
9470771
Compare
Choose a tag to compare

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.

image

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

22 Feb 11:25
Compare
Choose a tag to compare

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

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

Full Changelog: v0.10.0...v0.11.0

v0.10.0

07 Feb 10:36
Compare
Choose a tag to compare

What's Changed

Features

Fixes

Other

Full Changelog: v0.9.0...v0.10.0

v0.8.0 The "Fuego" release 🔥

18 Dec 14:44
5a961ee
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.7.0...v0.8.0