I need to read JSON data from .json file and store in JS variable

I create two files in my Apigee proxy one file where named swagger.json and other one is read-swagger.js

In swagger.jso I have json data which I need to read through JS file and store in a variable.

Currently getting below error.

Error: Module name \"Swagger.json\" has not been loaded yet for context: _. Use require([])

Expectation -:

Get the swagger data in a JS variable.


Is it possible in APIGEE? Any suggestions?


0 2 337
2 REPLIES 2

You showed the error but not your code.

Also we are missing other context. Are you trying to read the .json file from within a JS callout?

If you provide more information, someone may be able to help you.

Help US to help YOU.

@Dino-at-Google I want to ask one question regarding Apigee Saas based environment but unable to send it due to below issue So put it as a comment here

10521-unable2sendques.png

Ques -: We need to setup a Saas based Apigee environment. I have few queries related for SaaS based environment.

  1. Who is going to take care LoadBalancing, Availability zone, Scaling and DR parts.
  2. If first point is handle by Apigee itself than do we need to tell the Apigee team that how many LB we need.
  3. Is there any document that can help us to understand what are the steps we need to follow for Apigee Saas based setup.

As I always work as a Apigee developer So I don't know do we need to do anything for Apigee Saas based setup. I always think Apigee will handle everything in Saas based environm