Service Virtualization

Expand all | Collapse all

can we create VS from YAML file ? could not see any option for YAML in DevTest

  • 1.  can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 23, 2016 12:56 PM

    can we create VS from YAML file ? could not see any option for YAML in DevTest



  • 2.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Broadcom Employee
    Posted Feb 23, 2016 05:50 PM

    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.

     

    Thanks!



  • 3.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 24, 2016 06:01 AM

    Thanks Koustubh..

    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



  • 4.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Broadcom Employee
    Posted Feb 24, 2016 03:04 PM
      |   view attached

    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.

    Attachment(s)

    zip
    test.yml.zip   782 B 1 version


  • 5.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 25, 2016 10:58 AM

    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]

    ERROR - Failed to parse Swagger resource

    ERROR - Swagger file failed to parse

     

    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 ?



  • 6.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 24, 2016 04:53 PM

    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)



  • 7.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 25, 2016 11:08 AM

    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 ?



  • 8.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 25, 2016 11:27 AM

    correct.. that is our experience, and the response from CA Support when we opened an issue.



  • 9.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 25, 2016 03:20 PM

    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.



  • 10.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 25, 2016 03:30 PM

    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 ?



  • 11.  Re: can we create VS from YAML file ? could not see any option for YAML in DevTest

    Posted Feb 25, 2016 04:02 PM

    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