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:
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:
In short, it is a contract between the API and its consumers.
OpenAPI specifications allow you to:
For GenAI‑assisted development, OpenAPI acts as ground truth. Instead of guessing shapes of payloads, Copilot can rely on explicit schemas.
SAS publishes OpenAPI specifications for many SAS Viya REST APIs on developer.sas.com.
These specifications typically cover APIs such as:
Each API page usually includes:
Go to: https://developer.sas.com
From there:
On each API documentation page, you will find a button labeled Download.
Download the specification file to your local project directory, for example:
Before involving Copilot, make sure you have:
Recommended VS Code extensions:
GitHub Copilot shines when it has context. An OpenAPI file provides extremely rich context.
You are not asking Copilot to invent an API client.
You are asking it to translate a formal contract into code.
Place the downloaded .ymlfile directly in your workspace.
VS Code + Copilot will automatically index it.
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
OpenAPI schemas map naturally to:
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.
…it can generate surprisingly complete and accurate service layers.
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:
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.
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.
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →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.