XMLWordPrintable

Details

    Description

      Instructions for customers with new 2.9 accounts who want to serve OAS2 specs.

      To configure OAS 2.0 in the Developer Portal, add a new page or replace the default Documentation page with the following snippet:

      <h1>Documentation</h1>
      {% cdn_asset /swagger-ui/2.2.10/swagger-ui.js %}
      {% cdn_asset /swagger-ui/2.2.10/swagger-ui.css %}
      
      {% include 'shared/swagger_ui' %}
      
      <script type="text/javascript">
        $(function () {
          window.swaggerUi.load();
        });
      </script>

      Instructions for customers who already switched to OAS3 on 2.8 and who want to keep serving them in 2.9 

      If customer already updated manually the template, it should look like this:

      {% content_for javascripts %}
       {{ 'active_docs.js' | javascript_include_tag }}
      {% endcontent_for %}
      
      <h1>Documentation</h1>
      
      <div class="swagger-section">
       <div id="message-bar" class="swagger-ui-wrap"></div>
       <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
      </div>
      
      <script type="text/javascript">
        (function () {
          var url = "{{provider.api_specs.first.url}}";
          SwaggerUI({ url: url, dom_id: "#swagger-ui-container" });
        }());
      </script>
      

      Then, should replace it with:

      {% content_for javascripts %}
       {{ 'active_docs.js' | javascript_include_tag }}
      {% endcontent_for %}
      
      {% assign spec = provider.api_specs.first %}
      
      <h1>Documentation</h1>
      
      <div class="swagger-section">
       <div id="message-bar" class="swagger-ui-wrap"></div>
       <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
      </div>
      
      <script type="text/javascript">
       (function () {
         var url = "{{spec.url}}";
         var serviceEndpoint = "{{spec.api_product_production_public_base_url}}"
         SwaggerUI({ url: url, dom_id: "#swagger-ui-container" }, serviceEndpoint);
       }());
      </script>
      

      Instructions for customers with existing 2.9 accounts who want to serve OAS3 spec

      Use same template used for "Instructions for customers who already switched to OAS3 on 2.8 and who want to keep serving them in 2.9 "

      {% content_for javascripts %}
       {{ 'active_docs.js' | javascript_include_tag }}
      {% endcontent_for %}
      
      {% assign spec = provider.api_specs.first %}
      
      <h1>Documentation</h1>
      
      <div class="swagger-section">
       <div id="message-bar" class="swagger-ui-wrap"></div>
       <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
      </div>
      
      <script type="text/javascript">
       (function () {
         var url = "{{spec.url}}";
         var serviceEndpoint = "{{spec.api_product_production_public_base_url}}"
         SwaggerUI({ url: url, dom_id: "#swagger-ui-container" }, serviceEndpoint);
       }());
      </script>
      

       

      Attachments

        Activity

          People

            jsmolar Jakub Smolár
            tmaas-1 Thomas Maas
            Jakub Smolár Jakub Smolár
            Priscill Orue Priscill Orue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: