Forum Discussion

Stoplight's avatar
Community Manager
5 months ago

Prism - Is there a way to get from a spec into IBundledHttpService instead of IHttpOperation

Originally posted by user fexzera to the Stoplight Community on 10/31/2022 at 10:52 ET.

Hi everyone, I'm working on a way to create contract tests dynamically from a spec file using Prism, so far I've managed to dynamically generate tests using the Prism client and a testing framework, so far it works only for get requests as I'm having issues parsing the body for other types of requests.

I see that Prism includes a way to get operations from a spec using getHttpOperationsFromSpec.

However, all of this information that is in the components object of IBundledHttpService would be very helpful for what I'm trying to accomplish using Prism.

If that's not possible, a way to turn the the "request" object inside each operation into a JSON body would be very helpful.

No RepliesBe the first to reply