Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

7/8/24, 11:45 AM GitHub - mulesoft/api-designer: A web editor for creating and sharing RAML API specifications

This repository has been archived by the owner on May 10, 2024. It is now read-only.

mulesoft / api-designer Public archive

A web editor for creating and sharing RAML API specifications

View license

1.1k stars 268 forks Branches Tags Activity

Star Notifications

Code Issues 45 Pull requests 8 Actions Projects 2 Security Insights

master 18 Branches 49 Tags Go to file Go to file Code

carowright last scope fix & update dist 1d5892f · 5 years ago

app last scope fix & update dist 5 years ago

bin Add proxy to bin 7 years ago

dist last scope fix & update dist 5 years ago

docs Fix typo in docs/file-system.md (thanks to htt… 10 years ago

scenario setLine and removeLine from codemirror rep… 7 years ago

test DESIGNER-3439 fix tests 5 years ago

.babelrc Bump oas-raml-converter 8 years ago

.editorconfig Added app skeleton and dependencies 11 years ago

.gitattributes Added app skeleton and dependencies 11 years ago

.gitignore Update criptoJs 8 years ago

.jshintrc Worker in RAML.worker variable 7 years ago

.travis.yml DESIGNER-1881 fix travis build 7 years ago

CONTRIBUTING.md adding contribution file 9 years ago

Gruntfile.js Bump oas-raml-converter and raml-suggesti… 6 years ago

LICENSE Update LICENSE 11 years ago

README.md Update README 7 years ago

bower.json New version 5 years ago

karma.conf.js DESIGNER-3439 fix token 5 years ago

main.html dist updated 7 years ago

package-lock.json Version 0.5.0 5 years ago

package.json New version 5 years ago

README License

https://github.com/mulesoft/api-designer 1/4
7/8/24, 11:45 AM GitHub - mulesoft/api-designer: A web editor for creating and sharing RAML API specifications

API Designer
gitter join chat

API Designer is a standalone/embeddable editor for RAML (RESTful API Modeling Language) written in JavaScript using Angular.JS.
By default, the editor uses an in-browser filesystem stored in HTML5 Localstorage.

Examples of designing RAML with API Designer in the Wild


Remote Medicine API
Notes API
Congo API for Drone Delivery

API Designer online


There is an online preview version of the API Designer, check it out a different branch.

Running Locally

npm install -g api-designer

api-designer

This will start a local designer instance using the in-browser filesystem.

Embedding
The following example details how to embed the API Designer:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>My App</title>
<link rel="stylesheet" href="styles/api-designer-vendor.css">
<link rel="stylesheet" href="styles/api-designer.css">
</head>
<body ng-app="ramlEditorApp">
<raml-editor></raml-editor>
<script src="scripts/api-designer-parser.js"></script>
<script>
if (window.Worker) {
// enable optional web worker for raml parsing
window.RAML.worker = new Worker('scripts/api-designer-worker.js#parser=./api-designer-parser.js&proxy=/proxy/');
}
</script>
<script src="scripts/api-designer-vendor.js"></script>
<script src="scripts/api-designer.js"></script>
<script>
// This part is needed only if you want to provide your own Persistance Implementation
// Angular Module must match "ramlEditorApp"

function myFileSystem($q, config, $rootScope) {


var service = {};

service.directory = function (path) {


var deferred = $q.defer();

https://github.com/mulesoft/api-designer 2/4
7/8/24, 11:45 AM GitHub - mulesoft/api-designer: A web editor for creating and sharing RAML API specifications

// Your magic goes here:


// Do deferred.resolve(data); to fulfull the promise or
// deferred.reject(error); to reject it.

// In case you want to send notifications to the user


// (for instance, that he must login to save).
// The expires flags means whether
// it should be hidden after a period of time or the
// user should dismiss it manually.
$rootScope.$broadcast('event:notification', {message: 'Loading directory' + path, expires: true});

return deferred.promise;
};

service.load = function (path, name) {


var deferred = $q.defer();

// Your magic goes here:


// Do deferred.resolve(data); to fulfull the promise or
// deferred.reject(error); to reject it.

return deferred.promise;
};

service.remove = function (path, name) {


var deferred = $q.defer();

// Your magic goes here:


// Do deferred.resolve(data); to fulfull the promise or
// deferred.reject(error); to reject it.

return deferred.promise;
};

service.save = function (path, name, contents) {


var deferred = $q.defer();

// Your magic goes here:


// Do deferred.resolve(data); to fulfull the promise or
// deferred.reject(error); to reject it.

return deferred.promise;
};

return service;
}

angular.module('ramlEditorApp')
.config(function (fileSystemProvider) {
// Set myFileSystem as the filesystem to use
fileSystemProvider.setFileSystemFactory(myFileSystem);
});
</script>
<style>
html,
body {
height: 100%;
}
</style>
</body>
</html>

Contribution
If you want to contribute to this project, please read our contribution guide first.

https://github.com/mulesoft/api-designer 3/4
7/8/24, 11:45 AM GitHub - mulesoft/api-designer: A web editor for creating and sharing RAML API specifications

License
Copyright 2013 MuleSoft, Inc. Licensed under the Common Public Attribution License (CPAL), Version 1.0

Releases 38

v0.6.0 Latest
on Oct 15, 2019

+ 37 releases

Packages

No packages published

Contributors 36

+ 22 contributors

Languages

JavaScript 91.8% CSS 5.2% HTML 3.0%

https://github.com/mulesoft/api-designer 4/4

You might also like