Service Virtualization

  • 1.  Creating REST API Services using Swagger definition

    Posted Sep 02, 2015 08:45 PM
      |   view attached

    Hi,

     

    I am trying to create REST API service using a swagger definition (.json) in 8.3 version. Lisa seems to identify all the operations and scenarios correctly.

    However its not able to deference schema objects within the response object. So the VSI response just has strings like "Schema Ref = ErrorModel" instead of the actual response constructed out of the ErrorModel schema definition.

    Swagger- VSI.jpg

     

    I am also attaching the definition file. Has anyone encountered this before/am I doing something wrong?

     

    Thank you,

    Amruta

    Attachment(s)

    zip
    petstore.json.zip   1 KB 1 version


  • 2.  Re: Creating REST API Services using Swagger definition
    Best Answer

    Posted Sep 03, 2015 09:25 AM

    see my prior topic https://communities.ca.com/thread/241733596

    I opened a support ticket on this same issue, and was told this is how it works.   they do not (yet/maybe ever) support the data type schemas as parameters of a transaction

     

    the only way I could get the data type info was to use actual messages, instead of the yaml.   for me the 'exactness' of the matching was a problem, I didn't have any actual messages, as this is a brand new api.

    so even constructing a few by hand from the spec was painful.

     

    add one parameter in the incoming message and boom, no match.. but because they don't know about arrays, optional parms, etc.. its gets dicy fast, schema validation also is not flexible enough

    when u have a large set of data types (like 60) and u only want to validate against ONE for each message url. 

     

    I gave up and did something different. still use the vsm framework to control the logic, and just the no match message in the vsi.  I do all the rest in groovy.

    drive off a spreadsheet and a profile of transaction urls.