News · Apr 17, 2023
Unlock consistent API design with Shared Components
When APIs are designed consistently, developers can more easily understand how to interact with them, reducing the learning curve and time to value. Standardizing your API also makes it easier to maintain and update at scale, as teams no longer have to reinvent different solutions to the same problem.
This week we're releasing Shared Components, enabling you to standardize object models and reuse them anywhere in your API.
For example, if your API frequently deals with addresses, you might define an Address component to use anywhere you have a mailing_address
or billing_address
field. This is a win-win for your developers and your team. Developers get the benefits of a predictable and easy-to-use API, and your team doesn't have to keep reopening the "zip vs postal code" debate.
Getting started
To turn any object into a shared component:
- Click on an attribute's type to open the Attribute Type inspector.
- Click Create Shared Component.
- Enter a short, but memorable name for your new component.
Your object is now a shared component and will appear as it's own item in the sidebar.
To reuse a shared component elsewhere:
- Click on an attribute's type to open the Attribute Type inspector.
- Choose the Shared Component from the list of available types.
We’d love to hear what you think about this update. Contact us at feedback@criteria.sh to share your thoughts.