Java Parser VS JavaScript Parser


#1

Hi all,

I’m starting a new project where I have to parse and validate some huge Ramls
I’m free to choose the technology so I made some Pros&Cons but I cant still choose between one and another…

I would appreciate some opinions based on your experience.

for example:

  • Documentation: Javascript parser has decent docs. Java parser has none…

Thanks


#2

Hi @esopo, I think you should choose what you’d like to use. Both are almost the same, there are only differences in the interface itself, but nothing sophisticated which might make a huge difference.

I used both and where perfectly able to use the JSON object (JS) and the Java object to build more logic on top.

Let me ask you a question. Are you only looking to parse and validate?


#3

Hi @christian_vogel, thanks for your response

Im looking to parse all the Raml specification and add custom validations.

I’ve seen that adding custom validations to the JS parser is quite easy with validationPlugins
But in the JAVA parser I can’t see how to add them without modifyng the source code…

Also Im having problems with the Java parser, when overwritting a Type property that is not string…


#4

MH, if it’s for custom validation; use the JS parser. The current version of the Java parser does not support that.


#5

Well, I supposed that…
In that case I will go for the JS.

thanks!


#6

hi
can u please provide a link, how to use JS parser for Raml.
i am implementing in angular.
after installing raml parser, i m getting following error.

ERROR in ./node_modules/raml-1-parser/dist/parser/ast.core/LowLevelASTProxy.js
Module not found: Error: Can’t resolve ‘…/…/…/resources/errorMessages’ in ‘C:\Users\prateek.jain\Desktop\mssql_phase_code_2\n
ode_modules\raml-1-parser\dist\parser\ast.core’
resolve ‘…/…/…/resources/errorMessages’ in ‘C:\Users\prateek.jain\Desktop\mssql_phase_code_2\node_modules\raml-1-parser\dist
parser\ast.core’
using description file: C:\Users\prateek.jain\Desktop\mssql_phase_code_2\node_modules\raml-1-parser\package.json (relative pat
h: ./dist/parser/ast.core)
after using description file: C:\Users\prateek.jain\Desktop\mssql_phase_code_2\node_modules\raml-1-parser\package.json (relati
ve path: ./dist/parser/ast.core)
using description file: C:\Users\prateek.jain\Desktop\mssql_phase_code_2\node_modules\raml-1-parser\package.json (relative p
ath: ./resources/errorMessages)