What is a package?
Every folder in your API definition is a package.
The generated SDK will match the hierarchy of your API definition.
__package__.yml will appear at the root of the package.
For example, the following generated SDK
would have a
that contains the following
Each package has its own namespace. This means you can reuse type names and error names across packages.
This is useful when versioning your APIs. For example, when you want to increment your API version, you can just copy the existing API to a new package and start making changes. If the new API version reuses certain types or errors, that's okay because the two APIs live in different packages.
__package__.yml also allows you to configure the navigation order
of your services. This is relevant when you want to control the display
of your documentation.
For example, let's say you have the following Fern Directory:
Your API will be sorted alphabetically: projects, roles, then users. If you
want to control the navigation, you can add a
and configure the order.
fern directory structure will now look like: