Listen to this article. Also available on Spotify. Subscribe to PolyAPI Squawk.
As part of the catalog and generated SDKs, Poly offers both functions and schemas (or types). Schemas make development easier by providing structured models to work with—saving time, improving accuracy, and enabling powerful IDE features such as IntelliSense and auto-completion. Schemas are also dynamically passed into our AI assistant to help it generate accurate examples.
What’s New in Release 21
In Release 21, we’ve significantly enhanced how schemas are generated, accessed, and shared:
- Root Namespace Access: Schemas are now generated as part of their own root namespace. You’ll find them in the SDK tree under a dedicated folder called Schemas.
- Usage in Code: When imported into your code, schemas now appear in a fully-qualified format, such as: schemas.Oob.Mews.Account
- Public Visibility: Schemas can now be marked as visibility:PUBLIC, making them accessible to all users of Poly (assuming your tenant has publishing rights). This aligns schemas with other Poly primitives and greatly improves their discoverability and usability.
These improvements make it possible to publish and use object models via Poly, which can be directly integrated into your codebase. While most schemas are generated through OAS-based training, you’re free to define schemas more broadly and independently of integration logic.
As a developer, you can now define your own types as schemas and use them anywhere in your project—thanks to the SDKs generated by Poly.
What’s Coming Next
Looking ahead, we’re planning several enhancements to make working with schemas in Poly even more powerful and intuitive:
- AI Assistant Discovery
Enhance the AI Assistant to directly discover schemas from the catalog, not just use them within function definitions. - AI Assistant Usage
Refactor the AI Assistant so it uses existing schemas directly, rather than generating new interfaces. Currently, the Assistant recognizes schemas but still creates new types unnecessarily. - AI-Driven Post Processing
Introduce an AI-powered process to evaluate real-time Poly traffic against catalog schemas and propose updates when there are mismatches between the two. - Server and Client Function References
Today, when deploying a function that references a schema, Poly creates a new schema. We aim to offer an option for developers to link directly to existing schemas instead. - Example-Based Generation
Allow users to pass an example object when creating a new schema. Poly will infer the schema from the example, significantly speeding up schema creation. - Native Schema Checking Function
Publish an out-of-the-box client function that evaluates an object against a schema and returns a clear, user-friendly response. - Execution Console
Leverage schemas within the execution console to display expected models and provide real-time validation for function arguments.
How to Try These Enhancements
Ready to try it out? Follow these steps:
- Sign up for free
- Set up your environment
- Generate an SDK
- Add the schema to your code
import poly from “polyapi”
const account: schemas.Oob.Mews.Account = {}
Your IDE will recognize the schema and provide full IntelliSense support, allowing you to easily populate and validate the attributes of the account object.
Questions or Feedback?
Have questions about our roadmap or platform? We’d love to hear from you! Reach out to us at hello@polyapi.io, fill out a contact form, or book an intro meeting.