Skip to content

Commit 7bfe33b

Browse files
committed
fixup
1 parent 75d527c commit 7bfe33b

File tree

2 files changed

+12
-0
lines changed
  • customizations/generator/openapi/src/main/resources/post-processor/assets/templates
    • get-lodging-listings-operation-params
    • get-lodging-quotes-operation-params

2 files changed

+12
-0
lines changed

customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-listings-operation-params/rooms.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
fun rooms(rooms: List<Room>) =
22
apply {
3+
if (rooms.size > 8) {
4+
throw PropertyConstraintViolationException(
5+
constraintViolations = listOf("rooms: size must be between 0 and 8")
6+
)
7+
}
8+
39
rooms.elementAtOrNull(0)?.let {
410
this.room1Adults = it.adults
511
this.room1ChildAges = it.childAges?.map { item -> item.toString() }

customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-quotes-operation-params/rooms.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
fun rooms(rooms: List<Room>) =
22
apply {
3+
if (rooms.size > 8) {
4+
throw PropertyConstraintViolationException(
5+
constraintViolations = listOf("rooms: size must be between 0 and 8")
6+
)
7+
}
8+
39
rooms.elementAtOrNull(0)?.let {
410
this.room1Adults = it.adults
511
this.room1ChildAges = it.childAges?.map { item -> item.toString() }

0 commit comments

Comments
 (0)