Skip to content

Releases: icerockdev/web-utils

release/0.7.3: Bug fix

10 Dec 02:26

Choose a tag to compare

Fix wrong locale i18n

#24 Fix annotation translation

20 Nov 05:27
08afb5e

Choose a tag to compare

This problem linked with a custom I18NMessageInterpolator where the category was set as an empty string ("") and the i18n don't find the needed bundle for translations.

private fun interpolateMessage(message: String? , context: MessageInterpolator.Context?, locale: Locale?): String {
       return i18n.t(super.interpolate(message, context, locale), "", locale)
    }

This fix changes the empty string to null and i18n will find the default bundle (in the app)

private fun interpolateMessage(message: String? , context: MessageInterpolator.Context?, locale: Locale?): String {
       return i18n.t(super.interpolate(message, context, locale), null, locale)
    }

release/0.7.1: Bug fix & downgrade Kotlin & Ktor versions

04 Sep 05:23
72f7029

Choose a tag to compare

release/0.7.1: Bug fix & downgrade Kotlin & Ktor versions

  • Downgrade Kotlin & Ktor versinons because Ecposed not updated to 1.4
  • Fix log response body on exceptions
  • Other minor improvements

Migration guide:

  • com.icerockdev.webserver.applyStatusConfiguration now need mapper and logger
    StatusPages install sample:
install(StatusPages) {
    applyStatusConfiguration(
        logger = LoggerFactory.getLogger(Application::class.java),
        mapper = jacksonObjectMapper().apply {
            applyDefaultConfiguration()
            applyPrettyPrintConfiguration()
        }
    )
}
  • com.icerockdev.webserver.getMonitoringPipeline deleted
    Delete this line in project:
intercept(ApplicationCallPipeline.Monitoring, getMonitoringPipeline())
  • ObjectMapper.applyObjectMapper replaced to ObjectMapper.applyDefaultConfiguration
    JsonDataLogger install sample
install(JsonDataLogger) {
    mapperConfiguration = {
        applyDefaultConfiguration()
        applyPrettyPrintConfiguration()
        applyJsonSecretConfiguration()
    }
    loggingConfiguration =
        LoggingConfiguration(
            responseTypes = listOf(AbstractResponse::class, CustomResponse::class),
            requestTypes = listOf(Request::class)
        )
}

release/0.7.0: Bug fix & update versions

02 Sep 03:54
4b22510

Choose a tag to compare

  • Update Java version to 11
  • Update Kotlin & Ktor versions
  • Avoid using springframework components for BCrypt and keep backward compatibility
  • Bug fix message interpolator and strict StrictEmail validation constraint
  • Add workfow for pull request (build & test)
  • Optimize imports

release/0.6.1: String enum validation (#18)

04 Jun 08:52
339508d

Choose a tag to compare

Append validator by string enum

Change validation logic

01 Jun 07:46
5bbc599

Choose a tag to compare

Refactoring package com.icerockdev.api.Request

Migration guide:

  • Replace request.isValid() and request.isValidRecursive() to request.validate() and request.validRecursive(), respectively.
  • For get list of error need call request.getErrorList().

Example:

post("/object") {
          val request = call.receiveRequest<TestRequest>()
          if (!request.validate()) {
               throw ValidationException(request.getErrorList())
          }
          call.respond(TestResponse2(200, request.email, request.password))
}

Optimize utils with boilerplate

22 May 08:25
90c9b7b

Choose a tag to compare

Refactoring com.icerockdev.util

Migration guide:

  • Delete from project directory common/util/src/main/kotlin/com/icerockdev/common/util/ if exist
    • File HashUtils.kt, now use from library
    • File CheckNetwork.kt, now use from library
    • File DoubleReceive.kt, no longer needed
  • Delete from project all functions for generate passwords, digit codes, confirmation tokens and verify passwords, use web-utils/src/main/kotlin/com/icerockdev/util/HashUtils.kt instead.
  • Reimport Pagination, Parameters, QueryParser from com.icerockdev.api.request instead of com.icerockdev.util

change configuration API to apply struct

21 May 14:40
13f9af7

Choose a tag to compare

WD-321 Make default configurations rewritable (#15)

* WD-321 Make default configurations rewritable

* WD-321 Fix sample

* WD-321 Fix filter API configuration

* WD-321 Fix version, small fixes

* WD-321 Fix version, small fixes

* WD-321 change configuration API to apply struct

Co-authored-by: Alex Shvedov <alexeii.shvedov@gmail.com>

RequestDataLogger enabling only by special route featured

14 May 15:34
1dbf74b

Choose a tag to compare

Merge pull request #13 from icerockdev/logger_update

RequestDataLogger enabling only by special route featured

Fix for jackson serializer

20 Apr 09:23
c09096a

Choose a tag to compare

Merge pull request #11 from icerockdev/serialization_fix

Fixed serialization problem for responses