Skip to content

Commit 7af14a3

Browse files
committed
Bumps version and fixes two issues.
1 parent 1e91f54 commit 7af14a3

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
kotlin.code.style=official
22

3-
version_boofcv=1.1.7
4-
version_javalin=6.4.0
5-
version_kotlin=2.1.10
6-
version_kotlinx_json_jvm=1.8.0
7-
version_log4j2=2.24.3
8-
version_pdfbox=3.0.4
3+
version_boofcv=1.2.4
4+
version_javalin=6.7.0
5+
version_kotlin=2.2.20
6+
version_kotlinx_json_jvm=1.9.0
7+
version_log4j2=2.25.2
8+
version_pdfbox=3.0.5
99
version_qrbill=3.3.1
1010
version_slf4j=2.0.17

src/main/kotlin/ch/pontius/swissqr/api/handlers/qr/Generate.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import java.math.BigDecimal
2323
path = "/api/qr/simple/{type}",
2424
methods = [HttpMethod.GET],
2525
pathParams = [
26-
OpenApiParam("type", OutputSize::class, "Type of generated invoice. Can either be A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_BILL_WITH_HORIZONTAL_LINE or QR_CODE_ONLY."),
26+
OpenApiParam("type", OutputSize::class, "Type of generated invoice. Can either be A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_CODE_ONLY, QR_BILL_EXTRA_SPACE, QR_BILL_WITH_HORIZONTAL_LINE or PAYMENT_PART_ONLY."),
2727
],
2828
queryParams = [
2929
OpenApiParam("amount", Double::class, "Amount to be printed on the invoice.", required = true),
@@ -91,7 +91,7 @@ fun getGenerateUnstructuredQRCode(ctx: Context) {
9191
path = "/api/qr/structured/{type}",
9292
methods = [HttpMethod.GET],
9393
pathParams = [
94-
OpenApiParam("type", OutputSize::class, "Type of generated invoice. Can either be A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_BILL_WITH_HORIZONTAL_LINE or QR_CODE_ONLY."),
94+
OpenApiParam("type", OutputSize::class, "Type of generated invoice. Can either be A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_CODE_ONLY, QR_BILL_EXTRA_SPACE, QR_BILL_WITH_HORIZONTAL_LINE or PAYMENT_PART_ONLY."),
9595
],
9696
queryParams = [
9797
OpenApiParam("amount", Double::class, "Amount to be printed on the invoice.", required = true),
@@ -169,7 +169,7 @@ fun getGenerateStructuredQRCode(ctx: Context) {
169169
OpenApiParam(API_KEY_HEADER, String::class, description = "API Token used for authentication. Syntax: Bearer <Token>", required = true)
170170
],
171171
pathParams = [
172-
OpenApiParam("type", OutputSize::class, "Type of generated invoice. Can either be A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_BILL_WITH_HORIZONTAL_LINE or QR_CODE_ONLY."),
172+
OpenApiParam("type", OutputSize::class, "Type of generated invoice. Can either be A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_CODE_ONLY, QR_BILL_EXTRA_SPACE, QR_BILL_WITH_HORIZONTAL_LINE or PAYMENT_PART_ONLY."),
173173
],
174174
queryParams = [
175175
OpenApiParam("format", GraphicsFormat::class, "File format of the resulting QR code (PNG, PDF or SVG). Defaults to PNG."),
@@ -190,7 +190,7 @@ fun postGenerateStructuredQRCode(ctx: Context) {
190190
/* Extract invoice from request body. */
191191
val bill = try {
192192
ctx.bodyAsClass(Bill::class.java).toProcessableBill()
193-
} catch (e: BadRequestResponse){
193+
} catch (_: BadRequestResponse){
194194
throw ErrorStatusException(400, "HTTP body could not be parsed into a valid QR invoice model!")
195195
}
196196

@@ -212,13 +212,13 @@ private fun generateQRCode(bill: net.codecrete.qrbill.generator.Bill, ctx: Conte
212212
/* Extract and validate format parameters. */
213213
try {
214214
bill.format.outputSize = OutputSize.valueOf(ctx.pathParamMap().getOrDefault("type", "QR_BILL_ONLY").uppercase())
215-
} catch (e: IllegalArgumentException) {
216-
throw ErrorStatusException(400, "Illegal value for parameter 'type'. Possible values are A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_BILL_WITH_HORIZONTAL_LINE or QR_CODE_ONLY!")
215+
} catch (_: IllegalArgumentException) {
216+
throw ErrorStatusException(400, "Illegal value for parameter 'type'. Possible values are A4_PORTRAIT_SHEET, QR_BILL_ONLY, QR_CODE_ONLY, QR_BILL_EXTRA_SPACE, QR_BILL_WITH_HORIZONTAL_LINE or PAYMENT_PART_ONLY!")
217217
}
218218

219219
try {
220-
bill.format.language = Language.valueOf(ctx.pathParamMap().getOrDefault("language", "EN").uppercase())
221-
} catch (e: IllegalArgumentException) {
220+
bill.format.language = Language.valueOf(ctx.queryParam("language")?.uppercase() ?: "EN")
221+
} catch (_: IllegalArgumentException) {
222222
throw ErrorStatusException(400, "Illegal value for parameter 'language'. Possible values are DE, FR, IT or EN!")
223223
}
224224

0 commit comments

Comments
 (0)