Skip to content

Possibility for multiple example values with LambdaDSL #1850

@huehnerlady

Description

@huehnerlady

HI,

I try to migrate this old Pact to the new LambdaDsl:

                    .body(PactDslJsonBody()
                        .minArrayLike("features", 1,2)
                        .stringType("name", "FEATURE", "FEATURE_2")
					)

My solution is:

                    .body(
                        newJsonBody { o: LambdaDslJsonBody ->
                          o.minArrayLike("features", 1, 2) { feature ->
                            feature.stringType("name", "FEATURE")
                          }
                        }.build()
                    )

Unfortunately I did not find a solution to provide multiple example values like in the 'old world'.
What I would have expected would be:

                    .body(
                        newJsonBody { o: LambdaDslJsonBody ->
                          o.minArrayLike("features", 1, 2) { feature ->
                            feature.stringType("name", "FEATURE", "FEATURE_2")
                          }
                        }.build()
                    )

So please provide this method :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIndicates new feature requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions