Listen to this article. Also available on Spotify. Subscribe to PolyAPI Squawk.
Some API providers offer a single endpoint for their API globally, such as api.fooprovider.com. Others may have multiple region-specific instances like eu.fooprovider.com/api, and some have customer-specific instances (or simply many instances), for example, customerbar.fooprovider.com/api. Sometimes, one or a few of these are provided in the OpenAPI Specification (OAS), while other times, none are included.
Enhancements in Release 19
To handle all of these situations, we have extended our CLI-based training to support three distinct cases:
- Hardcoded HostUrl – Users can now pass –hostUrl with the actual host URL to hardcode it. This ensures that function users cannot provide a host URL when invoking the functions—all functions will route to the same service hostUrl.
- HostUrl as an Argument – Users can pass –hostUrlAsArgument, allowing the function to expect an argument for the desired hostUrl. A string for the argument name can be provided; if not, it defaults to hostUrl.
- Use Server Config from OAS – If no argument is passed, the server configurations specified in the OAS will be used.
See for Yourself
If you would like to train OpenAPI specifications to Poly, sign up here and then install our TypeScript CLI with: npm install polyapi
From there, you can run: npx poly model generate –help to explore these options.
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.