can we create VS from YAML file ? could not see any option for YAML in DevTest
Yes you can. This ability was added around 8.1 if i remember correctly. You can use the "From Swagger 2.0 specification" option and provide the yaml file. You can provide the URL or a yaml file.
Ping me if it does not work for you.
I tried building VS via yaml but it failed to pickup the endpoint and methods..
I captured the system messages logs.. it shows
INFO - com.fasterxml.jackson.databind.node.BooleanNode cannot be cast to com.fasterxml.jackson.databind.node.TextNode (through reference chain: com.wordnik.swagger.models.ModelImpl["properties"]) (through reference chain: com.wordnik.swagger.models.Swagger["definitions"])
ERROR - Failed to parse Swagger resource
ERROR - Swagger file failed to parse
ERROR - Unable to process swagger
From the above error I think it is related to yaml file issue where it is trying cast from boolean to text.. but if any suggestion will be helpful.. thanks
Can you try out the attached file to see if it works for you? I just tried and saw that the Endpoints and the Methods got populated. I copied this file to the C:\ drive and pointed to that location.
Thanks.. I tried creating using your attached yml .. not success
below is the system message..
INFO - Unexpected character ('s' (code 115)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
INFO - at [Source: C:\test.yml; line: 1, column: 2]
I am using 8.3 version of devtest.. Have you tried this test.yml in 8.3 ?
also can we have any format .yaml or yml ?
what version of the yaml swagger spec are you trying to use?
but note that the VS from Swagger does not yet create the correct VSI message patterns. (as the wizard doesn't read the message formats from the swagger yet)
I hope it should be 2.0 as my yaml starts with swagger: '2.0'..
another thing is I manage to modify some data fields in yaml file (as devtest was showing failing at that line)
and then devtest accepted my yaml file but it just created vsi.. there is no request parameter in the vsi and no proper response was formed under vsi response tab..
so that means still devtest is not fully equipped to build a vsi from yaml ?
correct.. that is our experience, and the response from CA Support when we opened an issue.
To be clear we don't support generic YAML. We do support SWAGGER 2.0 in either YAML or JSON format. Additionally there are some limitations in the way that we parse swagger 2.0 today, specifically around ref and schema elements. We are currently working on improving the parsing and more fully support the Specification.
Thanks Anand.. From your answer I cant consider YAML or Swagger 2.0 is way to build the virtual services .. Do you suggest any alternatives please ?
or do you expect swagger 2.0 or YAML in certain formats only ?
BUT, you do not support parsing the swagger for the data definitions required to build the vsi request parameters. all you get is an empty operation
effectively this is completely un-useful.
I had to build RR pairs manually from my swagger spec, and use THOSE to build the service.. when the spec changed, flush and repeat..
ended up building a completely independent service model, like DD
Retrieving data ...