Api-designer : Implementing my own "MyFileSystem"


#1

I’m having trouble getting my MyFileSystem to work with recent versions of the api-designer.
Api-Designer is failing to process the list of files I am giving it, and complains about path being null in RamlDirectory.

I have posted an issue on GitHub here: https://github.com/mulesoft/api-designer/issues/335

My issues appear to be similar to http://forums.raml.org/t/api-designer-problem-with-metadata-and-content-or-contents/272 but that was not answered.

I am using the latest master branch of api-designer/dist (as of about 5 days ago).

My ultimate goal is:

  • Provide a way to edit RAML files from an embedded jetty instance.
  • Save them into my project (using a jetty servlet) so that they can be managed in GIT.
  • Automatically build the docs for my webservice from the RAML as part of a maven build.
  • Provide a mocked webservice from the RAML for testing.

However, I’m currently stuck at the first item :frowning:

Any help would be great appreciated.


#2

Why edit via embedded jetty? We set up a simple nodejs/docker instance and a script that spawns the docker instance and opens up the browser to the designated port/instance. It allows you to specify a local path to “copy” into the docker instance that is then used by the nodejs/raml editor to work on… when all done, it copies the files back to the local host system. Match that up to a git repo directory and you’re set.


#3

Thanks for your response. I’m doing this for my home project at the moment, but ultimately would like to use it at work too.
We are a Java shop and our devs code on windows. We don’t have an environment to host Docker images at the moment.
We are already familiar with embedded Jetty as some of our services run there already. It’s the path of least re-learning for our guys. Running the api designer, will then be as simple as pull, mvn run (which could launch browser), edit, save, commit.


#4

Ah. well in case you’re interested… https://docs.docker.com/installation/windows/ seems to get going on windows with docker. Not sure how stable it is, relatively new. Only runs linux in docker, which is fine for this project you are referring to.

I am not entirely sure how you embed the designer inside of jetty, unless you mean to embed it as a web page that is served by jetty, in which case I think the project shows how to embed it in html?


#5

Docker on windows looking interesting. I will follow that.
But, yes, for this project the HTML, JS and images are served by jetty, and when the POST, GET, PUT and DELETE methods are called by the designer, the responses are handled in Jetty which reads and writes the files on the disk.

I have the code working to read the file list, and file content. I just need to do POST, PUT and DELETE now.

I had a response on the github issue which pointed me in the right direction. It was really just my misunderstanding of what the payload looks like. I’ll commit when I’m done. Hopefully this weekend or next.


#6

@justjacksonn can you point me a docker image that can work with the file system… I really need to edit my raml files from inside my project so that they can be version controlled along side my project.

If it matter I am on Ubuntu.

Thanks


#7

Hi, I am currently working on a small example for working with the file system. Probably next week, couldn’t get it done today, I’ll update the repo for the api-designer with some documentation.

You think a docker image with that would make a lot sense?


#8

Sorry for the delay.

I think a base Docker Image will be great as an example or to work on top of it :slight_smile:

I am learning RAML and will build a tool to generate a PHP Api from the RAML file and I would love to integrate the Api Designer, but without be able to version control the Raml file and access it from filesystem Api Designer is not a option.


#9

Agree - let me see what I can compile for you next week. I am bit swamped so sorry if it will take me some time :slight_smile:


#10

Take your time and thanks in advance :slight_smile: