Forum Discussion

devecserj's avatar
devecserj
Regular Visitor
4 years ago

yaml file cannot be imported into ReadyAPI

Hello,

 

for our API functional test we have received a service definition in a yaml file.
As far as I know, the yaml file is correct, the developer validated it and able to generate the client without any issues.

I tried to Import it into ReadyAPI but without any success.

Attached you can find the yaml file, ReadyAPI GUI error message and the stacktrace from readyapi-error.log

 

Thanks for your help!

  • Hey devecserj,

     

    If the developer is certain the .yml file is not malformed nor invalid, then I think versioning is the problem here.

     

    You gotta remember that .yaml is just a file type definition - the underlying thing you're importing has a specific version and i think that's where your problem lies.

     

    I struggle a lot with importing openAPIs, or swaggers in either .xml, or .json or .yml cos of the version I'm trying to import.

     

    to be honest - i think this a serious problem with the import procedure with ReadyAPI! and they need to sort it out.  You can import swaggers of version 1 or version 2 or openAPIs of version 3  - but there are many versions in between those principal version numbers - swagger 1.2, swagger 1.3, openAPI v3.0.3, etc. and if your file version isnt either swagger 1 or 2 or openAPI 3 (i.e. it cant import swagger 1.2) then the import doesn't work.  This has caught me out more times than I can say when I receive a swagger file but because the version isn't v2.0 exactly, the import procedure fails.

     

    possible resolutions to issue:

     

    1.  I'd go back to the developer and ask what file version is the .yaml?  swagger? openAPI?   Is it a 3rd party API or is it being internally developed - I'm wondering if it's internal - then perhaps you can ask them to generate the file in a version that ReadyAPI supports?

    If it's 3rd party then this depends on the relationship you have with them, but perhaps you could ask them to confirm what version of file you're running and whether they could re-generate in either swagger version 1 or 2 of openAPI 3?

     

     

    2.  you could perhaps try converting the file version when you know what is is - there are free online swagger/openAPI converters  out there - but I've never had any success in converting them

     

    3.  Looks like your running readyapi v3.5 - I'd try and upgrade to the latest version (just in case they added some functionality to handle this)

     

    4.  Last option I can think of  - you could try importing into Postman, save the new APIs as a collection and then export the collection and import back into ReadyAPI! - i've done that before and it worked out for me.

     

    cant think of anything else, perhaps some of the other forum members have some better ideas?

     

    ta

     

    rich

  • richie's avatar
    richie
    Community Hero

    Hey devecserj,

     

    If the developer is certain the .yml file is not malformed nor invalid, then I think versioning is the problem here.

     

    You gotta remember that .yaml is just a file type definition - the underlying thing you're importing has a specific version and i think that's where your problem lies.

     

    I struggle a lot with importing openAPIs, or swaggers in either .xml, or .json or .yml cos of the version I'm trying to import.

     

    to be honest - i think this a serious problem with the import procedure with ReadyAPI! and they need to sort it out.  You can import swaggers of version 1 or version 2 or openAPIs of version 3  - but there are many versions in between those principal version numbers - swagger 1.2, swagger 1.3, openAPI v3.0.3, etc. and if your file version isnt either swagger 1 or 2 or openAPI 3 (i.e. it cant import swagger 1.2) then the import doesn't work.  This has caught me out more times than I can say when I receive a swagger file but because the version isn't v2.0 exactly, the import procedure fails.

     

    possible resolutions to issue:

     

    1.  I'd go back to the developer and ask what file version is the .yaml?  swagger? openAPI?   Is it a 3rd party API or is it being internally developed - I'm wondering if it's internal - then perhaps you can ask them to generate the file in a version that ReadyAPI supports?

    If it's 3rd party then this depends on the relationship you have with them, but perhaps you could ask them to confirm what version of file you're running and whether they could re-generate in either swagger version 1 or 2 of openAPI 3?

     

     

    2.  you could perhaps try converting the file version when you know what is is - there are free online swagger/openAPI converters  out there - but I've never had any success in converting them

     

    3.  Looks like your running readyapi v3.5 - I'd try and upgrade to the latest version (just in case they added some functionality to handle this)

     

    4.  Last option I can think of  - you could try importing into Postman, save the new APIs as a collection and then export the collection and import back into ReadyAPI! - i've done that before and it worked out for me.

     

    cant think of anything else, perhaps some of the other forum members have some better ideas?

     

    ta

     

    rich