Easy & familiar syntax
Use a clean, Go-like syntax that’s easy to read and write. Define your API structure with intuitive language constructs.
Specular is an Open-Source DLS + Toolkit + Service to define modern API endpoints with automatic and ergonomic SDKs that feel like hand-written.
module.specular
fileEasy & familiar syntax
Use a clean, Go-like syntax that’s easy to read and write. Define your API structure with intuitive language constructs.
Fully typed error structures
Define structured error types that are automatically handled across all generated SDKs with full type safety.
Automatic Go Server and Client
Implement your API in Go and also get an ergonomic Client SDK
Automatic JS/TS NPM package
Get a fully typed TypeScript SDK automatically published as a private NPM package for your team. Works in Web, React Native and Node apps.
Reusable types and Libraries
Reuse types such as struct and errors across multiple API services.
Free Build Service
Automated cloud service builds and hosts your SDKs without any infrastructure setup or maintenance.
Example, the following is an API that simulates a Git hosting service:
service package
/// A Git repositorystruct Repository { /// name of the git repository name: string!}
/// Occurs when the repository name is invalidproblem struct InvalidRepositoryNameProblem { message: string!}
resource Repository { /// Creates a new Git repository operation Create { input struct { name: string! } output struct { repository: Repository }
/// Occurs when a repository with such name already exists raises struct RepositoryAlreadyExistsProblem { name: string! } raises InvalidRepositoryNameProblem; }
To get started, install the Deployport CLI:
sh curl -fsSL https://get.deployport.com | sh
Then initialize a new project in the current directory:
deployport specular init myns/mymod
It will create a few files:
module.specularspecular-module.yaml
When you’re ready:
deployport specular publish