CA Developer Portal: Adding custom code samples

book

Article ID: 76523

calendar_today

Updated On:

Products

CA API Developer Portal CA API Gateway

Issue/Introduction



How can custom language code samples be added to the CA Developer Portal 3.5?

Environment

Release:
Component: APIPRD

Resolution

1. Login to the CMS and navigate to /resources/code_sample_templates
2. Create a new item
3. Name the file as LANG.mustache where LANG will be the name of your desired language, ie: if using C Sharp you can name the file csharp.mustache
4. Edit the template-language-list.json and add a new section for the lanuage

        {
            "value" : "csharp",
            "label" : "C Sharp",
            "quoteStyle": "double"
        }

Where the label is what will be displayed in the drop down menu and quoteStyle denotes if the language uses single or double-quotes for strings so it knows how to properly escape them.

5. Save and publish the changes
6. Confirm in API Explorer that the new language is now available in the drop down menu