watsonx Assistant

 View Only
  • 1.  OpenAPI Extension - Unit Testing

    Posted Mon April 18, 2022 03:19 PM
    hi, 

    I have been testing with the OpenAPI extension.  The github Hubspot example works great. 
    I want to try other things and want to unit-test it externally before putting the extension into WA. 
    When I used swagger.io to test it, it gives me a CORS error. 

    Can the product team advise what's the best tool to test the openapi extension before putting into WA?  Or does WA has a openapi testing tool built in?  In addition, if we put in the extension, where to see the errors from the extension?  Thanks.

    Jane.

    ------------------------------
    Talent Creator (Jane Fung)
    Principal Educator
    Talent Creator Inc.
    educator@talentcreator.ca
    ------------------------------

    #WatsonAssistant


  • 2.  RE: OpenAPI Extension - Unit Testing

    Posted Mon April 18, 2022 06:01 PM
    I am exceptionally keen to follow this thread. Having same questions.





  • 3.  RE: OpenAPI Extension - Unit Testing

    Posted Tue April 19, 2022 12:34 PM

    I have tested the hubspot example on swagger hub, and didn't gett any errors,  so that seems odd to me. Swaggerhub is definitely the best place for testing, its such an amazing tool!

    We don't have anything built in because swaggerhub was so powerful it was already a perfect fit.

    If you want to see errors inside of your WA build, follow these steps:

    https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-call-extension#extension-debug-output



    ------------------------------
    Mitch Mason
    ------------------------------



  • 4.  RE: OpenAPI Extension - Unit Testing

    Posted Tue April 19, 2022 11:41 PM
    Thanks @Mitch Mason for the information. 
    The github sample works fine inside WA. 

    However, when I put in the openapi-spec.json to the SwaggerHub.  It loaded a default parameters.  Then I just executed it as-is.  There is an error about ​"hs_pipeline_stage" missing.

    After some research, it seems that we need to use "properties" instead of "request" in the call, then the call becomes successful. 


    After updating to "properties" then the default call is good.  Might want to update the github with this small change so the default call from SwaggerHub is good.  Thanks.



    ------------------------------
    Talent Creator (Jane Fung)
    Principal Educator
    Talent Creator Inc.
    educator@talentcreator.ca
    ------------------------------