API Console:
You can generate more sophisticated documentation from a RAML file using the API Console web component. The resulting HTML is similar in style to raml2html, but it has a killer feature; it provides a console which allows people to interact with your API from within the documentation. It takes care of building forms for you for any available parameters, validating them according to your definitions, as well as being able to work out how to perform authentication.
To see it in action, there are demos online for Twitter and Github. If you’ve been using the Anypoint Platform you’ll have seen it already; it’s what’s used to generate the interactive documentation in the right-hand column.
API Console is implemented using Angular, but you don’t necessarily need any experience with it in order to use it.
To get up-and-running quickly, simply follow these steps:
- Clone the repository:
git clone git@github.com:mulesoft/api-console.git - Copy the
distfolder into an empty directory to hold your documentation - Copy your
.ramlfile somewhere in that folder - Create an HTML file as follows:
<head>
<link rel="stylesheet" href="dist/styles/app.css" type="text/css" />
</head>
<body ng-app="ramlConsoleApp" ng-cloak id="raml-console-unembedded">
<raml-console src="api.raml"></raml-console>
<script src="dist/scripts/vendor.js"></script>
<script src="dist/scripts/app.js"></script>
</body>
That’s all there is to it. You can also embed the API Console in an iframe; refer to the project’s README for details.
Very nice information on Mulesoft. You can also check goformule.com for mulesoft tutorials
ResponderEliminar