View on GitHub

analyticsapi-engines-sdk-generator

FactSet

Analytics API Engines SDK Generator

Apache-2 license

This repository contains all the configurations and customizations required to generate API client libraries (SDKs) for FactSet’s Analytics API Engines product. It replies on the API’s OpenAPI Specification document and uses the OpenAPI Generator tool for SDK generation.

Follow the below links for generated language specific SDK repositories.

Contents

Contributing

Generate new version of the SDKs

API SDK Automation Process Overview Note: The steps highlighted in green are all automated using GitHub Action Worflows.

Configure new language

...
...
env:
    GITHUB_<<language-name>>_SDK_REPO: <<sdk-repository-location>>
...
...
jobs:
...
...
    <<language-name>>:
        runs-on: ubuntu-latest

        steps:
        - name: Check out SDK repository
            if: env.GITHUB_<<language-name>>_SDK_REPO
            uses: actions/checkout@v2
            with:
            repository: $
            path: sdk
            fetch-depth: 0
            token: $

        - name: Check out Generator repository
            if: env.GITHUB_<<language-name>>_SDK_REPO
            uses: actions/checkout@v2
            with:
            path: generator

        - name: Generate SDK
            if: env.GITHUB_<<language-name>>_SDK_REPO
            run: generator/.github/scripts/generate-sdk.sh $OPENAPI_GENERATOR_VERSION <<language-name>> <<generator-name>>

        - name: Raise pull request on SDK repository
            if: env.GITHUB_<<language-name>>_SDK_REPO
            run: generator/.github/scripts/raise-pull-request.sh <<language-name>>

Generation of SDKs locally

Prerequisites

Steps

  1. Build the Docker image

     docker build --build-arg VERSION=5.1.0 \
         -t openapi-generator-cli-custom \
         -f ./openapi-generator/Dockerfile \
         ./openapi-generator
    
  2. Run the Docker image to generate SDK. The languages/*/sdk directory will contain the generated files. In the below script, replace the <<generator-name>> with standard OpenAPI generator names or custom ones supported by this repository.

     docker run --rm -v ${PWD}:/generator \
         openapi-generator-cli-custom generate \
         --generator-name <<generator-name>> \
         --input-spec /generator/openapi-schema.json \
         --output /generator/languages/<<directory-name>>/sdk \
         --config /generator/languages/<<directory-name>>/openapi-generator-config.json \
         --template-dir /generator/languages/<<directory-name>>/templates \
         --skip-validate-spec
    

Note: The gitignore file is configured to ignore the languages/*/sdk directories. These are only for local testing purposes and should not be checked in.