Releases: go-goyave/goyave
Releases · go-goyave/goyave
Pre-release v5.0.0-rc8
- Improved docs
server.Stop()
doesn't attempt to stop the server a second time if it was already stopped- Validation: added
validation.Context
accessors for current element path and array element errors - Validation: added
validation.Context
methodsAddValidationError
andAddValidationErrors
so validators can merge additional errors that may be coming from nested validation validation.Context
'sExtra
field is nevernil
- Fixed
OPTIONS
method not added to routes if their router inherited their CORS settings from parent router - Updated dependencies
- Improved language files unmarshal error messages
Pre-release v5.0.0-rc7
- Updated dependencies
- Improved thread-safety of server status
- Updated contribution resources (issue templates, etc) and license
Pre-release v5.0.0-rc6
slog
: custom errors implementingslog.LogValuer
are now handled correctly and will be added as reason attribute.- Added parameter name hints on
goyave.Handler
so IDEs automatically name request and response properly when auto-completing. testutil
: when usingTestMiddleware
, the cloned request sent to the middleware now uses the samecontext.Context
as the original request.- Updated dependencies and CI
Pre-release v5.0.0-rc5
- Added a name to special routes (the
notFound
andmethodNotAllowed
routes) so it is possible to know if there was no matched route from inside a global middleware. testutil.TestMiddleware
now also copies therequest.Route
.⚠️ The auth middleware is now only executed if the matched route (or one of its parents) have the metaauth.MetaAuth
set totrue
. This means theauth.Middleware
is now meant to be used as a global middleware. Routers and routes can be individually marked as requiring auth or not.
Pre-release v5.0.0-rc4
- Improvements to the
session
package to make manual transaction (begin, commit, rollback) easier and to improve support on nested transaction (that can possibly involve multiple different services).- The
Session
interface now has aContext() context.Context
method. Begin()
now also injects the transaction DB in the new session's context.Begin()
andTransaction()
now use the DB retrieved from the given context if available. This makes nested transactions possible even if the service is using the root session.
- The
Pre-release v5.0.0-rc3
-database.Paginator
now uses a cloned statement for the count query to avoid modifying the original statement.
- Wrap errors using
errors.New()
in many places that were not already doing it. - Added
errors.Errorf
, which is a shortcut forerrors.New(fmt.Errorf())
. ⚠️ errors.New()
anderrors.NewSkip()
now returnnil
if givennil
as argument.nil
values in[]error
and[]any
reasons are now ignored.⚠️ errors.New()
,errors.NewSkip()
anderrors.Errorf()
now returnerror
interface instead of*errors.Error
to improve ability to compare tonil
.- Added a safeguard on
Response.error()
againstnil
errors. - Added a safeguard on
slog.Logger.logError()
againstnil
errors. - Updated internal uses of the util
errors
package according to the new changes described above.
Pre-release v5.0.0-rc2
- Removed the
directory
argument inrouter.Static
. The static handler now uses the FS relative root directory as a base. Use a sub FS if you want to serve a sub directory. - Updated dependencies.
Pre-release v5.0.0-rc1
- Added new server options
- Added config entry
server.readHeaderTimeout
which represents the amount of time allowed to read request headers. - Added
Options.BaseContext
, allowing to define the base context for the server. - Added
Options.ConnContext
, allowing to modify the context used for new client connections. - Added
Options.ConnState
, allowing to get notified when the client connection state changes. - Added
Options.MaxHeaderBytes
, which controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line.
- Added config entry
- Improvements on the embedded resources support:
- Added a
fsutil.Embed.Sub
method, allowing to get sub filesystems forembed.FS
. fsutil.Embed
now acceptsfs.ReadDirFS
instead ofembed.FS
- The lang package loads from root FS directory instead of forcing
resources/lang
, unless the FS implementsfsutil.WorkingDirDS
- Added a
Pre-release v5.0.0-preview7
Breaking changes are marked with a
⚠️ testutil: removed the route registrer parameter fromNewTestServer
andNewTestServerWithOptions
- Redirect the default test server logger to
testing.T.Log()
- Added the new
util/session
package for business transaction management. - Validation: the email validator now converts the value to string instead of
mail.Address
to improve the experience with DTO conversion.mail.Address
was serialized as a struct instead of a string. - Paginator: the page info query and the actual query are now executed in a transaction.
⚠️ Paginator:Find()
andUpdatePageInfo()
now return an error instead ofgorm.DB
Pre-release v5.0.0-preview6
- Removed requirements to implement
fsutil.FS
forfsutil.WorkingDirFS
,fsutil.MkdirFS
,fsutil.WritableFS
,fsutil.RemoveFS
- Fixed
RouteParams
were emptied if the matched route doesn't have parameters but its parents do. - Fixed error trace added twice as an attribute in slog when logging
*errors.Error
having a reason of type*errors.Error
. Only the correct trace is printed now. - Validation: the request context is now automatically attached to the DB in the validation middleware.
- Extra in request and validation are now using typed keys instead of strings. You can now (and you are encouraged to) use comparable structures as keys.
ExtraJWTClaims
key has been moved to theauth
package.