Releases: icerockdev/web-utils
Releases · icerockdev/web-utils
release/0.7.3: Bug fix
Fix wrong locale i18n
#24 Fix annotation translation
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
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
- 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)
Append validator by string enum
Change validation logic
Refactoring package com.icerockdev.api.Request
Migration guide:
- Replace
request.isValid()andrequest.isValidRecursive()torequest.validate()andrequest.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
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
- File
- 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.ktinstead. - Reimport
Pagination,Parameters,QueryParserfromcom.icerockdev.api.requestinstead ofcom.icerockdev.util
change configuration API to apply struct
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
Merge pull request #13 from icerockdev/logger_update RequestDataLogger enabling only by special route featured
Fix for jackson serializer
Merge pull request #11 from icerockdev/serialization_fix Fixed serialization problem for responses