All Versions
26
Latest Version
Avg Release Cycle
14 days
Latest Release
347 days ago

Changelog History
Page 1

  • v3.4.0 Changes

    November 06, 2020
    • Type-dependent rules validating integers (via the "integer" type rule) now share their validation message with the "numeric" type.
    • โž• Added paginators.
    • โž• Added helper.EscapeLike().
    • ๐Ÿš‘ Performance improvement by caching critical config entries (protocol, maxUploadSize and defaultLanguage). This change leads to about 18% more requests per second. However, these entries cannot be dynamically changed anymore: a server restart will be needed.
  • v3.3.1 Changes

    November 02, 2020
    • ๐Ÿ›  Fixed a bug in the validatior: the original value of type-converted fields was always used, leading to wrong validation of subsequent type-dependent rules.
  • v3.3.0 Changes

    October 30, 2020
    • โž• Added request.Extra. Thank you @gmgalvan for your contribution!
    • โœ… TestSuite now runs auto migrations if they're enabled before running the tests.
    • ๐Ÿ”ง TestSuite don't load config anymore if it's already loaded. This allows you to load a test configuration file using LoadFrom() before calling goyave.RunTest().
    • ๐Ÿšš response.JSON() doesn't remove hidden fields anymore. The use of json:"-" makes more sense and saves some execution time. Removing hidden fields manually is still possible.
  • v3.2.0 Changes

    October 21, 2020
    • โž• Added a way to customize the request's body field used by JWTController for the authentication process. (By default, "username" and "password" are used)
    • โž• Added a new validation rule: unique.
    • โž• Added helper.Only().
    • filesystem.File.Save() now creates directories if needed.
  • v3.1.0 Changes

    September 21, 2020
    • โž• Added support for validating objects (map[string]interface{}).
    • โž• Added request.Object() accessor.
  • v3.0.1 Changes

    September 12, 2020
    • ๐Ÿ›  Fixed a bug that prevented root-level routes with an empty path (/) to be matched.
  • v3.0.0 Changes

    September 10, 2020
    • ๐Ÿ”„ Changed conventions:
      • validation.go and placeholders.go moved to a new http/validation package.
      • Validation rule sets are now located in a request.go file in the same package as the controller.
    • ๐ŸŽ Validation system overhaul, allowing rule sets to be parsed only once instead of every time a request is received, giving better overall performance. This new system also allows a more verbose syntax for validation, solving the comma rule parameter value and a much easier use in your handlers.
      • Rule functions don't check required parameters anymore. This is now done when the rules are parsed at startup time. The amount of required parameters is given when registering a new rule.
      • Optimized regex-based validation rules by compiling expressions once.
      • A significant amount of untested cases are now tested.
      • The following rules now pass if the validated data type is not supported: greater_than, greater_than_equal, lower_than, lower_than_equal, size.
      • Type-dependent rules now try to determine what is the expected type by looking up in the rule set for a type rule. If no type rule is present, falls back to the inputted type. This change makes it so the validation message is correct even if the client didn't input the expected type.
      • Fixed a bug triggering a panic if the client inputted a non-array value in an array-validated field.
    • Routing has been improved by changing how validation and route-specific middleware are registered. The signature of the router functions have been simplified by removing the validation and middleware parameters from Route(), Get(), Post(), etc. This is now done through two new chainable methods on the Route: route.Validate() and route.Middleware().
    • ๐ŸŒฒ Log Formatter now receive the length of the response (in bytes) instead of the full body.
    • ๐Ÿ”ง Configuration system has been revamped.
      • Added support for tree-like configurations, allowing for better categorization. Nested values can be accessed using dot-separated path.
      • Improved validation: nested entries can now be validated too and all entries can have authorized values. Optional entries can now be validated too.
      • Improved support for slices. The validation system is also able to check slices.
      • Entries that are validated with the int type are now automatically converted from float64 if they don't have decimal places. It is no longer necessary to manually cast float64 that are supposed to be integers.
      • More openness: entries can be registered with a default value, their type and authorized values from any package. This allows config entries required by a specific package to be loaded only if the latter is imported.
      • Core configuration has been sorted in categories. This is a breaking change that will require you to update your configuration files.
      • Entries having a nil value are now considered unset.
      • Added accessors GetInt() and GetFloat().
      • Added slice accessors: GetStringSlice(), GetBoolSlice(), GetIntSlice(), GetFloatSlice()
      • Added LoadFrom(), letting you load a configuration file from a custom path.
      • Added the ability to use environment variables in configuration files.
      • Bug fix: config.IsLoaded() returned true even if config failed to load.
      • maxUploadSize config entry now supports decimal places.
    • Database improvements
      • Goyave has moved to GORM v2. Read the release note to learn more about what changed.
      • Protect the database instance with mutex.
      • database.Close() can now return errors.
      • Added database connection initializers.
      • Added the ability to regsiter new SQL dialects to use with GORM.
      • Use utf8mb4 by default in database options.
      • Added a short alias for database.GetConnection(): database.Conn().
      • Factories now use batch insert.
      • Factories now return interface{} instead of []interface{}. The actual type of the returned value is a slice of the the type of what is returned by your generator, so you can type-assert safely.
    • Status handlers improvements
      • Export panic and error status handlers so they can be expanded easily.
      • Added goyave.ValidationStatusHandler(), a status handler for validation errors. Therefore, the format in which validation errors are sent to the client can be customized by using your own status handler for the HTTP status 400 and 422.
    • goyave.Response improvements
      • response.Render and response.RenderHTML now execute and write the template to a bytes.Buffer instead of directly to the goyave.Response. This allows to catch and handle errors before the response header has been written, in order to return an error 500 if the template doesn't execute properly for example.
      • Added response.GetStacktrace(), response.IsEmpty() and response.IsHeaderWritten().
      • Re-organised the goyave.Response structure fields to save some memory.
      • Removed deprecated method goyave.CreateTestResponse(). Use goyave.TestSuite.CreateTestResponse() instead.
    • Recovery middleware now correctly handles panics with a nil value.
    • Test can now be run without the -p 1 flag thanks to a lock added to the goyave.RunTest method. Therefore, goyave.TestSuite still don't run in parallel but are safe to use with the typical test command.
    • ๐ŸŽ Cache the regex used by helper.ParseMultiValuesHeader() to improve performance. This also improves the performance of the language middleware.
    • ๐Ÿ› Bug fix: data under validation wasn't considered from JSON payload if the content type included the charset.
    • โฌ†๏ธ The Gzip middleware will now skip requests that have the Upgrade HTTP header set to any value.
    • response.String() and response.JSON() don't write header before calling Write anymore. This behavior prevented middleware and chained writers to alter the response headers.
    • โž• Added goyave.PreWriter interface for chained writers needing to alter headers or status before they are written.
      • Even if this change is not breaking, it is recommended to update all your chained writers to call PreWrite() on their child writer if they implement the interface.
      • Thanks to this change, a bug with the gzip middleware has been fixed: header Content-Length wasn't removed, resulting in false information sent to the clients, which in turn failed to decompress the response.

    โฌ†๏ธ Read the upgrade guide here.

  • v3.0.0-rc2 Changes

    August 31, 2020
    • 0๏ธโƒฃ Use utf8mb4 by default in database options.
    • โž• Added goyave.ValidationStatusHandler(), a status handler for validation errors. Therefore, the format in which validation errors are sent to the client can be customized by using your own status handler for the HTTP status 400 and 422.
    • ๐ŸŽ Cache the regex used by helper.ParseMultiValuesHeader() to improve performance. This also improves the performance of the language middleware.
    • โž• Added a short alias for database.GetConnection(): database.Conn().
    • ๐Ÿ“š Updated documentation.
  • v3.0.0-rc1 Changes

    August 24, 2020
    • ๐Ÿ”„ Changed conventions:
      • validation.go and placeholders.go moved to a new http/validation package.
      • Validation rule sets are now located in a request.go file in the same package as the controller.
    • ๐ŸŽ Validation system overhaul, allowing rule sets to be parsed only once instead of every time a request is received, giving better overall performance. This new system also allows a more verbose syntax for validation, solving the comma rule parameter value and a much easier use in your handlers.
    • Routing has been improved by changing how validation and route-specific middleware are registered. The signature of the router functions have been simplified by removing the validation and middleware parameters from Route(), Get(), Post(), etc. This is now done through two new chainable methods on the Route: route.Validate() and route.Middleware().
    • ๐ŸŒฒ Log Formatter now receive the length of the response (in bytes) instead of the full body.
    • ๐Ÿ”ง Configuration system has been revamped.
      • Added support for tree-like configurations, allowing for better categorization. Nested values can be accessed using dot-separated path.
      • Improved validation: nested entries can now be validated too and all entries can have authorized values. Optional entries can now be validated too.
      • Entries that are validated with the int type are now automatically converted from float64 if they don't have decimal places. It is no longer necessary to manually cast float64 that are supposed to be integers.
      • More openness: entries can be registered with a default value, their type and authorized values from any package. This allows config entries required by a specific package to be loaded only if the latter is imported.
      • Core configuration has been sorted in categories. This is a breaking change that will require you to update your configuration files.
      • Entries having a nil value are now considered unset.
      • Added accessors GetInt() and GetFloat().
      • Added LoadFrom(), letting you load a configuration file from a custom path.
      • Added the ability to use environment variables in configuration files.
      • Bug fix: config.IsLoaded() returned true even if config failed to load.
    • ๐Ÿ“œ Rule functions don't check required parameters anymore. This is now done when the rules are parsed at startup time. The amount of required parameters is given when registering a new rule.
    • โšก๏ธ Optimized regex-based validation rules by compiling expressions once.
    • โœ… A significant amount of untested cases are now tested.
    • Protect the database instance with mutex.
    • Recovery middleware now correctly handles panics with a nil value.
    • The following rules now pass if the validated data type is not supported: greater_than, greater_than_equal, lower_than, lower_than_equal, size.
    • Type-dependent rules now try to determine what is the expected type by looking up in the rule set for a type rule. If no type rule is present, falls back to the inputted type. This change makes it so the validation message is correct even if the client didn't input the expected type.
    • ๐Ÿ›  Fixed a bug triggering a panic if the client inputted a non-array value in an array-validated field.
    • response.Render and response.RenderHTML now execute and write the template to a bytes.Buffer instead of directly to the goyave.Response. This allows to catch and handle errors before the response header has been written, in order to return an error 500 if the template doesn't execute properly for example.
    • Test can now be run without the -p 1 flag thanks to a lock added to the goyave.RunTest method. Therefore, goyave.TestSuite still don't run in parallel but are safe to use with the typical test command.
    • ๐Ÿ‘ maxUploadSize config entry now supports decimal places.
    • โž• Added database connection initializers.
    • Re-organised the goyave.Response structure fields to save some memory.
    • โž• Added the ability to regsiter new SQL dialects to use with GORM.
    • database.Close() can now return errors.
    • โž• Added response.GetStacktrace(), response.IsEmpty() and response.IsHeaderWritten().
    • โœ‚ Removed deprecated method goyave.CreateTestResponse(). Use goyave.TestSuite.CreateTestResponse() instead.
    • Export panic and error status handlers so they can be expanded easily.
  • v2.10.2 Changes

    July 02, 2020
    • ๐Ÿ›  Fixed a bug in body parsing middleware preventing json body to be parsed if a charset was provided.