@@ -492,8 +492,10 @@ object RestActionBuilderV3 {
492492 null
493493 }
494494 } ? : listOf ()
495+
495496 val action = RestCallAction (actionId, verb, restPath, params, produces = produces,
496- operationId = operation.operationId, links = links)
497+ operationId = operation.operationId, links = links
498+ )
497499
498500 // TODO update for new parser
499501// /*This section collects information regarding the types of data that are
@@ -591,6 +593,7 @@ object RestActionBuilderV3 {
591593 messages : MutableList <String >
592594 ) {
593595 val name = p.name ? : " undefined"
596+ val description = p.description
594597
595598 if (p.schema == null ){
596599 messages.add(" No schema definition for parameter $name " )
@@ -621,16 +624,14 @@ object RestActionBuilderV3 {
621624 }
622625
623626 when (p.`in `) {
624-
625- " query" -> {
626- params.add(QueryParam (name, gene, p.explode ? : true , p.style ? : Parameter .StyleEnum .FORM ))
627- }
627+ " query" -> params.add(QueryParam (name, gene, p.explode ? : true , p.style ? : Parameter .StyleEnum .FORM )
628+ .apply { this .description = description })
628629 /*
629630 a path is inside a Disruptive Gene, because there are cases in which we want to prevent
630631 mutation. Note that 1.0 means can always be mutated
631632 */
632633 " path" -> params.add(PathParam (name, CustomMutationRateGene (" d_" , gene, 1.0 )))
633- " header" -> params.add(HeaderParam (name, gene))
634+ " header" -> params.add(HeaderParam (name, gene). apply { this .description = description } )
634635 " cookie" -> params // do nothing?
635636 // TODO "cookie" does it need any special treatment? as anyway handled in auth configs
636637 else -> throw IllegalStateException (" Unrecognized: ${p.getIn()} " )
@@ -706,6 +707,7 @@ object RestActionBuilderV3 {
706707 }
707708
708709 val name = " body"
710+ val description = operation.description ? : null
709711
710712 val bodies = resolvedBody.content?.filter {
711713 /*
@@ -752,6 +754,8 @@ object RestActionBuilderV3 {
752754
753755 val contentTypeGene = EnumGene <String >(" contentType" , bodies.keys)
754756 val bodyParam = BodyParam (gene, contentTypeGene)
757+ .apply { this .description = description }
758+
755759 val ns = bodyParam.notSupportedContentTypes
756760 if (ns.isNotEmpty()){
757761 messages.add(" Not supported content types for body payload in $verb :$restPath : ${ns.joinToString()} " )
@@ -810,17 +814,22 @@ object RestActionBuilderV3 {
810814 if (schema.enum?.isNotEmpty() == true ) {
811815
812816 when (type) {
813- " string" ->
817+ " string" -> {
814818 return EnumGene (name, (schema.enum.map {
815819 if (it !is String )
816- LoggingUtil .uniqueWarn(log, " an item of enum is not string (ie, ${it::class .java.simpleName} ) for a property whose `type` is string and `name` is $name " )
820+ LoggingUtil .uniqueWarn(
821+ log,
822+ " an item of enum is not string (ie, ${it::class .java.simpleName} ) for a property whose `type` is string and `name` is $name "
823+ )
817824 it.toString()
818825 } as MutableList <String >).apply {
819- if (options.invalidData) {
826+ if (options.invalidData) {
820827 // Besides the defined values, add one to test robustness
821828 add(" EVOMASTER" )
822829 }
823830 })
831+ .apply { this .description = schema.description }
832+ }
824833 /*
825834 Looks like a possible bug in the parser, where numeric enums can be read as strings... got this
826835 issue in GitLab schemas, eg for visibility_level
@@ -1509,6 +1518,8 @@ object RestActionBuilderV3 {
15091518 else -> throw IllegalStateException (" cannot create gene with constraints for gene:${geneClass.name} " )
15101519 }
15111520
1521+ mainGene.description = schema.description
1522+
15121523 /*
15131524 See:
15141525 https://swagger.io/docs/specification/adding-examples/
@@ -1668,6 +1679,7 @@ object RestActionBuilderV3 {
16681679 minLength = max(defaultMin, if (options.enableConstraintHandling) schema.minLength ? : 0 else 0 ),
16691680 invalidChars = if (isInPath) listOf (' /' ,' .' ) else listOf ()
16701681 )
1682+ .apply { this .description = schema.description }
16711683 }
16721684
16731685 private fun createObjectFromReference (name : String ,
0 commit comments