@@ -25,6 +25,7 @@ import com.papsign.ktor.openapigen.annotations.type.string.length.Length
2525import com.papsign.ktor.openapigen.annotations.type.string.length.MaxLength
2626import com.papsign.ktor.openapigen.annotations.type.string.length.MinLength
2727import com.papsign.ktor.openapigen.annotations.type.string.pattern.RegularExpression
28+ import com.papsign.ktor.openapigen.annotations.type.string.trim.Trim
2829import com.papsign.ktor.openapigen.interop.withAPI
2930import com.papsign.ktor.openapigen.model.Described
3031import com.papsign.ktor.openapigen.model.server.ServerModel
@@ -235,6 +236,12 @@ object TestServer {
235236 respond(InstantResponse (params.date))
236237 }
237238 }
239+
240+ route(" employees" ) {
241+ get<FilterQuery , FilterQuery > { params ->
242+ respond(params)
243+ }
244+ }
238245 }
239246 }
240247 }
@@ -404,4 +411,52 @@ object TestServer {
404411 data class InstantResponse (val instant : Instant )
405412 data class LocalTimeResponse (val time : LocalTime ? )
406413 data class OffsetTimeResponse (val time : OffsetTime ? )
414+
415+ data class FilterQuery (
416+ @QueryParam(" Vendor Code" ) @Trim
417+ val vendorCode : String? = null ,
418+ @QueryParam(" Organization" ) @Trim
419+ val organization : String? = null ,
420+ @QueryParam(" startDate" )
421+ val startDate : LocalDate ? = null ,
422+ @QueryParam(" endDate" )
423+ val endDate : LocalDate ? = null ,
424+ @QueryParam(" tenant" ) @Trim
425+ val tenant : String? = null ,
426+ @QueryParam(" manager" ) @Trim
427+ val manager : String? = null ,
428+ @QueryParam(" performer" ) @Trim
429+ val performer : String? = null ,
430+ @QueryParam(" condition" ) @Trim
431+ val condition : String? = null ,
432+ @QueryParam(" onlyNew" )
433+ val onlyNew : Boolean? = null ,
434+ @QueryParam(" name" ) @Trim
435+ val name : String? = null ,
436+ @QueryParam(" minQuantity" ) @Min(0 )
437+ val minQuantity : Int? = null ,
438+ @QueryParam(" maxQuantity" ) @Min(0 )
439+ val maxQuantity : Int? = null ,
440+ @QueryParam(" minCost" ) @Min(0 )
441+ val minCost : Int? = null ,
442+ @QueryParam(" maxCost" ) @Min(0 )
443+ val maxCost : Int? = null ,
444+ @QueryParam(" inStock" )
445+ val inStock : Boolean? = null ,
446+ @QueryParam(" active" )
447+ val active : Boolean? = null ,
448+
449+ @QueryParam(" employeeName" ) @Trim
450+ val employeeName : String? = null ,
451+
452+ @QueryParam(" sortToken" )
453+ @StringExample(" fullName" ) @Trim
454+ val sortToken : String? = null ,
455+ @QueryParam(" pageSize" )
456+ @Min(1 )
457+ val pageSize : Int? = null ,
458+ @QueryParam(" page" )
459+ @Min(0 )
460+ val page : Long? = 0
461+ )
407462}
0 commit comments