3 ms·
Thanks for checking out Fern! Smithy is an awesome library, and we love the VSCode extension that makes it easy to click around in the Smithy files. We built
by zachkirsch 4y ago
Thanks for checking out Fern!
Smithy is an awesome library, and we love the VSCode extension that makes it easy to click around in the Smithy files.
We built our own spec because there's a lot of cool SDK features that aren't supported in Smithy. For example:
- Audiences. It should be easy in the spec to specify some endpoints as "internal only" to include them in the internal SDKs, but exclude them from the external SDKs.
- Per-endpoint errors. Smithy doesn't have a concept of specifying which non-200 responses a particular endpoint might return. It's super helpful in the SDKs to know which errors might be thrown from a particular endpoint.
- Pagination. It should be easy in the spec to specify that an endpoint is paginated, so the SDK is able to page through results easily (e.g. for-await in TypeScript). Note: this is a WIP and not yet released in Fern.
Having our own spec also lets us be more creative with the feature set we provide. For example, we want to add support for websockets and webhooks.
All that said, we're not aiming to be a competing standard. There's so much tooling already for these different specs, and it should be easy to convert between them. Our Smithy->Fern converter is in development so that Smithy users can take advantage of our SDK generators.
- Existenceblinks 4y agoThanks for pointing out the why not. > Our Smithy->Fern converter is in development so that Smithy users can take advantage of our SDK generators. This is a good thing although there's definitely not going to be lossless. Smithy trait seem to be an escape hatch for everything, I believe it could be used to achieve the same but maybe not easier. They already have pagination traits. And their http error is per operation, endpoint is also per operation, so I think the error is bound to operation as well (https://smithy.io/2.0/spec/http-bindings.html#httperror-trait https://smithy.io/2.0/spec/http-bindings.html#httperror-trai...)
- zachkirsch 4y ago> Smithy trait seem to be an escape hatch for everything, I believe it could be used to achieve the same but maybe not easier. No doubt! This is definitely part of our thinking - there's a lot of things that are _possible_ in Smithy (and OpenAPI), but it requires you to be an expert and really understand how things work. For 90% of the use cases, it should be dead simple. For the remaining 10%, it's okay to rely on more complex features like plugins and traits.