Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Read JSON file (resources/oas/swagger-1.json) using Javascript Policy

I want to read swagger-1.json which is there in resources/oas folder in Javascript policy. Is there any possibility to do that?

My Intention is to write OASValidation using javascript Policy. For that I saw an example which makes use of swagger-1.js (var oas = <Swagger Spec>) which contains actual oas spec. But now as per my requirement I wanted to change swagger-1.js to swagge-1.json

Solved Solved
0 5 1,061
2 ACCEPTED SOLUTIONS

Not applicable

you can add the file in javascript <IncludeURL> tag inside a function.

You can call that function in the main javascript and validate it as required.

ref: https://stackoverflow.com/questions/55945687/is-there-a-way-to-retrieve-all-the-parameterseven-neste...

View solution in original post

Not applicable

you can use java callout also.

View solution in original post

5 REPLIES 5