api-elements.js icon indicating copy to clipboard operation
api-elements.js copied to clipboard

Rethink Fury API

Open kylef opened this issue 6 years ago • 1 comments

There are some rough edges to the Fury API such as singleton pattern (https://github.com/apiaryio/api-elements.js/pull/141#discussion_r253851981) and limitations of how adapters and media type handling works. The way that adapters declare media types and media type routing from Fury Core to the adapters is limited. For example, OpenAPI 2 and 3 should have same media type (application/vnd.oai.openapi) but the routing to two adapters is not possible.

The detection API is also a little cumbersome as each adapter provides serialsiation and some consumers want to be able to use detection without depending on parsers and serialisers etc. Hence why deckardcain was created to solve this need. We could rethink the API to allow detection to be slightly separate from paring and serialisation.

kylef avatar Feb 05 '19 13:02 kylef

Perhaps also the API should allow you to specify a path (or URL?) for the source to load it from disk, some similiar tools do so. Consumers of Fury core add this on themselves (fury-cli, Dredd, ApiaryUI, etc) and it will simplify the future when we support relative external referencing along with placing filename in the source maps.

kylef avatar Jun 05 '19 10:06 kylef