New API Modeling Framework now available as open source
Today, MuleSoft joined the OAI and open sourced a new API tool called the API Modeling Framework (AMF).
We are excited to make AMF available to the community, bringing together the RAML and OpenAPI ecosystems. AMF provides an approach to developing API that provides for parsing, interacting with, and generating API descriptions in any API description language.
Currently, there are several API description languages, like RAML and OpenAPI Specification (OAS). Without a way to provide tooling that can easily understand any API description language or a mechanism to go back and forth between languages easily, developers had to make a choice. AMF changes that.
We built a way to parse and generate any API specification (e.g. RAML or OAS) in a few steps. AMF makes RAML and OAS interoperable.
How it works
AMF provides a common programmatic interface that lets developers interact with any API specification, whether it is written in OAS or RAML. AMF operates similarly to how the HTML DOM allows programmatic interaction with an HTML document, Developers can use AMF to build strong validation and introspect the API, infer behavior or analyze the impact of changes; and they can programmatically access, manipulate, and emit API specifications.
Using AMF you can parse a RAML document into a common data model stored in a data graph (see image below).
This model can be queried and manipulated, then serialized back into a valid OAS document (for example).
There has been prior attempts to provide similar functionality, like Apiary’s API Elements, however those efforts did not provide all the querying features required to understand the relationships between all parts of an API specification. In contract, AMF was developed on proven W3C standardizations, relying on RDF internally to generate and query a complete model of the API specification.
Currently, the AMF is available as an alpha version and under the Apache 2 license, It is available for download or preview as a playground web application.
Long term we are exploring ways to provide implementations in multiple programming languages. Currently we use Clojure to be able to easily provide a version for JS and Java, but we’d love to hear your feedback.