BookmarkSubscribeRSS Feed

Building Applications Faster with SAS OpenAPI Specifications and GitHub Copilot in VS Code

Started ‎03-23-2026 by
Modified ‎03-23-2026 by
Views 456

Modern application development increasingly relies on well‑defined APIs and strong developer tooling. At SAS, most REST APIs are formally described using OpenAPI specifications, which are publicly available on developer.sas.com.

 

When you combine these specifications with Visual Studio Code and GitHub Copilot, you can dramatically accelerate application development—generating strongly typed clients, request/response models, and even boilerplate service code in Python or TypeScript with minimal effort.

 

In this post, we’ll walk through:

 

  1. What are OpenAPI specifications
  2. How to download SAS OpenAPI specs from developer.sas.com
  3. How to use GitHub Copilot in VS Code to generate Python types from those specs
  4. A practical workflow you can reuse for your own SAS integrations

 

What is an OpenAPI Specification?

 

OpenAPI (formerly known as Swagger) is an industry‑standard way to describe REST APIs in a machine‑readable format, typically YAML or JSON.

 

An OpenAPI specification defines:

 

  • Available endpoints (paths)
  • HTTP methods (GET, POST, PUT, DELETE, …)
  • Request parameters and payloads
  • Response structures and status codes
  • Authentication mechanisms (OAuth2, API keys, etc.)
  • Data models (schemas)

 

In short, it is a contract between the API and its consumers.

 

Why OpenAPI Matters for Developers

 

OpenAPI specifications allow you to:

 

  • Generate client SDKs automatically
  • Validate requests and responses
  • Produce accurate documentation
  • Enable AI tools (like GitHub Copilot) to reason about your API with high precision

 

For GenAI‑assisted development, OpenAPI acts as ground truth. Instead of guessing shapes of payloads, Copilot can rely on explicit schemas.

 

OpenAPI Specifications on developer.sas.com

 

SAS publishes OpenAPI specifications for many SAS Viya REST APIs on developer.sas.com.

 

These specifications typically cover APIs such as:

 

  • Job Definition and Job Execution
  • Compute
  • CAS Management
  • Files and Content
  • Identity and Authorization
  • Model Management and Analytics services

 

Each API page usually includes:

 

  • Human‑readable documentation
  • A downloadable OpenAPI definition

 

How to Download OpenAPI Specifications from developer.sas.com


Step 1: Navigate to the SAS Developer Portal

 

Go to: https://developer.sas.com 

 

From there:

 

  • Choose APIs
  • Select REST APIs
  • Select the SAS Viya service you are interested in (for example, Job Execution)

 

Step 2: Locate the OpenAPI Definition

 

On each API documentation page, you will find a button labeled Download.

 

Download the specification file to your local project directory, for example:

 

api_specs/
└── jobExecution-v7-openapi.yml
This file will be the foundation for everything that follows.

 

 

Setting Up Your VS Code Environment

 

Before involving Copilot, make sure you have:

 

  • Visual Studio Code
  • GitHub Copilot extension
  • GitHub Copilot enabled and signed in
  • Python or TypeScript tooling installed (depending on your target language)

 

Recommended VS Code extensions:

 

  • YAML (for syntax highlighting and validation)
  • Python or TypeScript language support
  • OpenAPI / Swagger Viewer (optional but useful)

 

Using GitHub Copilot with OpenAPI Specs

 

GitHub Copilot shines when it has context. An OpenAPI file provides extremely rich context.

 

Key Idea

 

You are not asking Copilot to invent an API client.

You are asking it to translate a formal contract into code.

 

 

Generating Python Types with GitHub Copilot

 

Step 1: Add the OpenAPI File to Your Project

 

Place the downloaded .ymlfile directly in your workspace.

 

VS Code + Copilot will automatically index it.

 

Step 2: Open a New Chat

 

Step 3: Prompt Copilot with Explicit Instructions

 

At the top of the file, write a clear comment:

 

Using the OpenAPI specification in jobExecution-v7-openapi.yaml, generate Python data models using pydantic for:
 - JobRequest
 - JobExecution
 - JobState
 
Within seconds, Copilot will typically:

 

  • Parse the schemas section of the OpenAPI file
  • Generate pydantic.BaseModel classes
  • Respect field names, types, and optionality

 

01_xab_OpenAPI_Copilot-models.png

 

 

You can then refine:

 

  • Field descriptions
  • Enum handling
  • Date/time parsing
  • Validation rules

 

Why This Works Well

 

OpenAPI schemas map naturally to:

 

  • pydantic models
  • Typed request/response objects
  • Safer, self‑documenting Python code

 

 

Going Further: Generating Service Code

 

Once types exist, you can push Copilot further:
 
Create a Python client class that wraps the SAS Job Execution REST API using httpx and the pydantic models defined above.

 

02_xab_OpenAPI_Copilot-client.png

 

 

Because Copilot can see:

 

  • The OpenAPI file
  • Your types
  • Your existing code

 

…it can generate surprisingly complete and accurate service layers.

 

 

Best Practices for This Workflow

 

  • Keep the OpenAPI file in your repo
  • Reference the file explicitly in Copilot prompts
  • Generate types first, logic second
  • Treat Copilot output as a draft, not final code
  • Leverage SAS authentication docs alongside OpenAPI

 

 

Conclusion

 

OpenAPI specifications are far more than documentation—they are executable knowledge. By downloading SAS OpenAPI definitions from developer.sas.com and combining them with GitHub Copilot in VS Code, you can:

 

  • Generate strongly typed models in minutes
  • Reduce API integration errors
  • Accelerate both frontend and backend development
  • Let GenAI work from a precise, authoritative contract

 

This approach turns API integration from a manual, error‑prone task into a fast, repeatable, and highly productive workflow—especially powerful in the SAS Viya ecosystem.

 

If you’re already working with SAS REST APIs, OpenAPI + Copilot is one of the highest‑ROI upgrades you can make to your development process.

 

 

Find more articles from SAS Global Enablement and Learning here.

Comments

Xavier, un grand merci (big thanks)! That's a very nice and well-timed article about using OpenAPI specifications in conjunction with agents from GitHub Copilot. It's a great use case, opening the door to a multitude of custom integrations across SAS products! Thanks. Keep on writing about this topic with other examples, I think it's highly relevant and important.

Contributors
Version history
Last update:
‎03-23-2026 04:25 AM
Updated by:

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags