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! Go to Solution.
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.
you can use java callout also.
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.
Thanks for the response sir.
.json file will be there in the resources folder. I need to read that .json and put it in javascript variable
you have to add the json file inside a javascript function and put the javascript in include tag.
Could you please provide a sample code for that
you can use java callout also.
User | Count |
---|---|
5 | |
2 | |
2 | |
1 | |
1 |