search cancel

Create Virtual Service from RAML throws parsing error

book

Article ID: 113004

calendar_today

Updated On:

Products

CA Application Test CA Continuous Application Insight (PathFinder)

Issue/Introduction

When creating a virtual service from a RAML file throws the below parsing error.

java.lang.Exception: RAML failed to parse 
at com.itko.lisa.vse.stateful.protocol.http.RAMLPanel.processNewRAML(RAMLPanel.java:503) 
at com.itko.lisa.vse.stateful.protocol.http.RAMLPanel.processRAMLChangeAndSelect(RAMLPanel.java:364) 
at com.itko.lisa.vse.stateful.protocol.http.RAMLPanel.setRAMLUrl(RAMLPanel.java:784) 
at com.itko.lisa.vse.stateful.protocol.http.RAMLPanel$1.actionPerformed(RAMLPanel.java:171) 
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) 
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) 
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) 
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) 
at javax.swing.AbstractButton.doClick(AbstractButton.java:376) 
 

Cause

One cause could be the "protocols" property is not defined properly.

As per RAML spec, the protocols property MUST be an array of strings of values "HTTP" and/or "HTTPS" : Protocols. Optionally, a RESTful API can be reached via HTTP, HTTPS, or both. The protocols property MAY be used to specify the protocols that an API supports. If the protocols property is not specified, the protocol specified at the baseUri property is used. 

If the protocols property is specified as below in the RAML file, this could be causing the RAML parsing error.
protocols: HTTPS

Environment

All supported DevTest environments.

Resolution

Changing the protocols property in RAML file as below will resolve the issue.

protocols: HTTPS ===> protocols: [HTTPS]