Mock/Real RAML Service


#1

Hi ,

Is there any mock/real RAML service available , Need to look at a the service , to understand the constructs used in practical.I have some samples download from the web not sure if its covers all/most of the constructs that can be used in 0.8 version.

-Paul


#2

Hi @Paul - You can go to https://anypoint.mulesoft.com/apiplatform/popular#/portals and browse through the examples there. Basically these are portals made by MuleSoft to give people the possibility to see real APIs using the RAML spec.

I should mention that: THOSE ARE NOT PORTALS/APIS CREATED BY THE SPECIFIC COMPANIES LIKE GITHUB :wink: It’s made by MuleSoft.

If you choose a specific API portal, you will be able to the details on it. If you want to see the RAML, click on API Reference and scroll to the end of the raml-console where you’ll be able to see a link. Click on it and you’ll be able to see/download the RAML.

Does this help?

BTW: The list of portals will be extended in the future.


#3

This is exactly what i was looking for , thanks a ton @christian_vogel
When i downloaded the raml , it has lot of includes for schema , which i was not able to find , where can i find all the includes and download them.

Because When i parse this raml file using the java parser it complains with lot of errors

ValidationResult{level=ERROR, message='resource type not defined: base'}
ValidationResult{level=ERROR, message='Include cannot be resolved /examples/friendships-update-example.json'}
ValidationResult{level=ERROR, message='trait not defined: acceptsUser'}
Exception in thread "main" java.lang.RuntimeException: resource not found: /resourceTypes/idsType.raml

#4

@Paul I don’t know for sure…but my guess is those schema files are “internal” to the HTML 5 browser on that site. The current designer stores everything in HTML 5 storage… no way to export it without copy/pasting each and every file manually. I am hoping with the 1.0 spec release (and tools), they fix this and make it possible to specify a directory to find raml and other files, and/or import/export options. On a large RAML API, it won’t be very convenient to have to manually import/export files all the time. So either a folder on disk that allows the end user to use SCM for the same folder, or some way to import/export the full RAML/Schema/etc files in one collection would be ideal.


#5

@justjacksonn - just a QQ: What do you mean by import/export? The API Designer is already able to do what you described.


#6

Oh…it could mean a lot of things. Primarily, if you look at the tool Postman, it has the ability to group things into a “collection” and export them as a single json file. Not that you would use json as the format, but if you can’t add the ability to allow us to point to a directory on disk and say “this is the root of my RAML project” and then have everything relative to that directory work within the designer, to me…the next best thing is some sort of zip import/export, where by I could use my favorite SCM, “checkout” my RAML root project with any sub-directories to a location on my local disk. I’d then zip up that directory, then import that zip into the RAML designer so that the entire structure, subdirs and all, would show up in designer. I could then work on all the files as needed, then export the entire thing back out as a zip file that I could then unzip over my existing SCM directory, and the commit the differences. That is NOT my ideal work flow, just a thought on how we might get an improved workflow over the initial designer process.

Having said all that, it would be more ideal, in my opinion, to work on the RAML plugins for IDEs, such as Eclipse, Visual Studio, and Sublime, with code completion, so that we could work within our familiar workflows and on disk, and still benefit the code completion that is very useful especially for new RAML designers. Even better, given the current threads on how large RAML files slow things down considerably when scrolling and such, using an IDE plugin would probably eliminate that issue as well.


#7

@justjacksonn - completely agree to what you’re saying - but you can do import/export with the current API Designer already - you can import and export a zip. So you have what you need.

With regards to the IDE - MuleSoft provides with the Anypoint Studio IDE (Eclipse) + APIkit a RAML editor with syntax highlighting and auto completion. Unfortunately, it’s not yet open source. There is also a Sublime plugin for RAML and MuleSoft also plans to add something to Visual Studio, but that will be added not before the next half of this year.

So to summarize:

  • import/export is available via API Designer
  • MuleSoft’s Anypoint Studio + APIkit provides a RAML editor with syntax highlighting and auto completion (not open source yet)
  • Sublime plugin for RAML editing
  • Visual Studio is planned

Stay tuned :wink:

Anything else? :stuck_out_tongue:


#8

Would LOVE to be able to work on files straight from disk - is a real pain to export/import each change. As with @justjacksonn , the end goal is to have raml changes tracked in SCM.


#9

@gilbert - you can do something like that today:


etc.


#10

Thanks @christian_vogel got it working.

However, this still involves an import - since the Console must be available on Anypoint cloud platform, else our users can’t see it.

Slightly less of an issue, since we will publish this less frequently, but the process is not 100%