You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If OpenAPI reference is defined for operationPreRequestScripts in variationTests then the reference value/pattern of OpenAPI reference will be ignored and all the prerequest scripts will be generated for all targets.
Eg. the oas yaml contains 2 paths:
The reason why the generated result was not as expected, is because of the double targeting:
"openApiOperation": "*::*" on variationTests level
and within the variation the "openApiOperationId" target as part of the "operationPreRequestScripts"
Portman variations are built with using a generic config but for variations, the targeting is focussed on the variationTests level.
As a workaround, you can define 2 variationTests for the 2 targets, see Archive.zip,
My expectation was that targeting should work like filtering from higher level down to lower layer in hierarchy of nested blocks. Something like piping grep commands in Linux.
As for this example it would work as follows:
For all operations ("openApiOperation": "*::*") with "openApiResponse": "400" create variation tests and for "openApiOperation": "*::/v1/system/products*" targets of that Variation tests run "scripts": ["console.log('systemProductsBody');" ] and for for "openApiOperationId": "lookup_products" of that Variation tests run "scripts": [console.log('productsBody');"]
I think it would be more intuitive and will give more flexibility to Portman. What do you think?
Hi,
If OpenAPI reference is defined for operationPreRequestScripts in variationTests then the reference value/pattern of OpenAPI reference will be ignored and all the prerequest scripts will be generated for all targets.
Eg. the oas yaml contains 2 paths:
and the Portman config looks like:
and the generated Postman collection will looks like:
for
/v1/products
path:for
'/v1/system/products'
:sample portman config and oas yaml files are attached as zip archive:
test-api.zip
The text was updated successfully, but these errors were encountered: