title: Use envars on swagger for dynamic configuration
body: <p>this may be trivial question, but I am having problems understanding server variables and how to modify them on swagger.</p>
  <p>My objective is to create a server using the specs below (5G 3gpp definitions for of its interfaces).</p>
  <p><a href="https://www.3gpp.org/ftp/Specs/archive/OpenAPI/Rel-16/TS29122_PfdManagement.yaml" rel="nofollow noreferrer">https://www.3gpp.org/ftp/Specs/archive/OpenAPI/Rel-16/TS29122_PfdManagement.yaml</a>.</p>
  <p>As you can see at the top of this file we have a server variable called <code>apiRoot</code> which defines the root of the url of the server. That is set up to default value of <code>example.com</code>. That url will later be used by swagger-ui to provide a graphic interface to the API.</p>
  <pre><code>servers:
    - url: '{apiRoot}/nnef-eventexposure/v1'
      variables:
        apiRoot:
          default: https://example.com
          description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501
  </code></pre>
  <p>I am trying to generate the server with the swagger-codegen which generates a consolidated file with all the elements this spec needs (since the original yaml file contains references to other files)</p>
  <pre><code>swagger-codegen generate -i  https://www.3gpp.org/ftp/Specs/archive/OpenAPI/Rel-16/TS29122_PfdManagement.yaml   -l go-server -o server
  </code></pre>
  <p>The problem is the file embeds the default value. So I can not use that file on multiple hosts.</p>
  <p>Is there any way to modify variable <code>apiRoot</code> when executing <code>swagger-codegen</code>? Or even better, is there any way to change the value of the default using some kind of <code>envar</code>? Or is there any way to pass swagger the value of <code>apiRoot</code></p>
  <p>The idea is we can use the same specs in different servers without having to modify the original spec file or the generated one. The problem with modifying the yaml files is that there will be more versions comming from 3gpp which will include <code>apiRoot</code> variable, so we don't wang to keep modifying every single time. We would like to overwrite it somehow on runtime.</p>