title: Adding environment variables to swagger documentation
body: <p>I have <code>swagger.json</code> file and the following AWS-lambda that serves it:</p>
  <pre><code>def get_openapi_spec(event, context):
      &quot;&quot;&quot;
      Returns the VarSAP Open API document.
      &quot;&quot;&quot;
      swagger_config = os.path.join(os.path.dirname(os.path.relpath(__file__)), &quot;swagger.json&quot;)
  
      with open(swagger_config, &quot;r&quot;) as content:
          schema = json.load(content)
  
      response = {
          &quot;statusCode&quot;: 200,
          &quot;headers&quot;: {&quot;Content-Type&quot;: &quot;application/json&quot;},
          &quot;body&quot;: json.dumps(schema),
      }
      return response
  </code></pre>
  <p>This provides the documentation for AWS-lambda based API (written in python).</p>
  <p>The information needs to be slightly different, based on the environment (development, integration, user acceptance, production). Environment information is available in environment variables.</p>
  <p>For example, the information displayed contains text: <code>Contact email: &lt;email&gt;. Additional information: &lt;url&gt;</code> - where <code>email</code> and <code>url</code> can be found in environment variables.</p>
  <p>How do I incorporate the values from environment variables?</p>