@@ -30,6 +30,7 @@ import com.papsign.ktor.openapigen.annotations.type.string.length.Length
3030import com.papsign.ktor.openapigen.annotations.type.string.length.MaxLength
3131import com.papsign.ktor.openapigen.annotations.type.string.length.MinLength
3232import com.papsign.ktor.openapigen.annotations.type.string.pattern.RegularExpression
33+ import com.papsign.ktor.openapigen.annotations.type.string.trim.Trim
3334import com.papsign.ktor.openapigen.interop.withAPI
3435import com.papsign.ktor.openapigen.model.Described
3536import com.papsign.ktor.openapigen.model.server.ServerModel
@@ -319,6 +320,12 @@ object TestServer {
319320 }
320321 }
321322 }
323+
324+ route(" employees" ) {
325+ get<FilterQuery , FilterQuery > { params ->
326+ respond(params)
327+ }
328+ }
322329 }
323330 }.start(true )
324331 }
@@ -412,4 +419,52 @@ object TestServer {
412419 data class InstantResponse (val instant : Instant )
413420 data class LocalTimeResponse (val time : LocalTime ? )
414421 data class OffsetTimeResponse (val time : OffsetTime ? )
422+
423+ data class FilterQuery (
424+ @QueryParam(" Vendor Code" ) @Trim
425+ val vendorCode : String? = null ,
426+ @QueryParam(" Organization" ) @Trim
427+ val organization : String? = null ,
428+ @QueryParam(" startDate" )
429+ val startDate : LocalDate ? = null ,
430+ @QueryParam(" endDate" )
431+ val endDate : LocalDate ? = null ,
432+ @QueryParam(" tenant" ) @Trim
433+ val tenant : String? = null ,
434+ @QueryParam(" manager" ) @Trim
435+ val manager : String? = null ,
436+ @QueryParam(" performer" ) @Trim
437+ val performer : String? = null ,
438+ @QueryParam(" condition" ) @Trim
439+ val condition : String? = null ,
440+ @QueryParam(" onlyNew" )
441+ val onlyNew : Boolean? = null ,
442+ @QueryParam(" name" ) @Trim
443+ val name : String? = null ,
444+ @QueryParam(" minQuantity" ) @Min(0 )
445+ val minQuantity : Int? = null ,
446+ @QueryParam(" maxQuantity" ) @Min(0 )
447+ val maxQuantity : Int? = null ,
448+ @QueryParam(" minCost" ) @Min(0 )
449+ val minCost : Int? = null ,
450+ @QueryParam(" maxCost" ) @Min(0 )
451+ val maxCost : Int? = null ,
452+ @QueryParam(" inStock" )
453+ val inStock : Boolean? = null ,
454+ @QueryParam(" active" )
455+ val active : Boolean? = null ,
456+
457+ @QueryParam(" employeeName" ) @Trim
458+ val employeeName : String? = null ,
459+
460+ @QueryParam(" sortToken" )
461+ @StringExample(" fullName" ) @Trim
462+ val sortToken : String? = null ,
463+ @QueryParam(" pageSize" )
464+ @Min(1 )
465+ val pageSize : Int? = null ,
466+ @QueryParam(" page" )
467+ @Min(0 )
468+ val page : Long? = 0
469+ )
415470}
0 commit comments