Forum Discussion

zx11ninja's avatar
zx11ninja
New Contributor
9 months ago

Consistent HTTP 500 Error When I Click Export API To SwaggerHUB

Hi all.

I am having an issue exporting my API to SwaggerHub.  I properly fill out the required fields (Name, API Version, Owner, Visibility).  However, each time I click the blue "Export API To SwaggerHub" button, I consistently get the response "Failex exporting testAPI 1version into SwaggerHub.  Error 500:"

I'm growing a little desparate, as I need to generate an OAS file to continue my development.  This 500 error is halting my progress.  I have rechecked my JSON for accuracy, and I see no errors.

Can someone please explain whether or not the issue is on my side or the SwaggerHub server side?

Thanks.

-Z

  • chewbika's avatar
    chewbika
    Occasional Contributor

    frankkilcomminsstill getting the 500 error

    When I click on the blue button, the `Overwrite existing API in SwaggerHub` prompt pops up after a 200 OK from https://api.explore.swaggerhub.com/sh/apis/{owner}/{Name}/{API version}.

    Once i click Okay. the call to https://api.explore.swaggerhub.com/spaces-api/v1/exports  always return 500.

    I have tried it with a different API Version. But the initiall call to /sh/apis returns 404 and the call to /v1/exports always return 500.

    Here is the link from `share snapshot`

  • chewbika 

    The Postman collections issue you linked above is a different issue that was just related to the CLI. 

    However, the Expore API to SwaggerHub issue that was related to this original post appears to have been resolved.

    FYI zx11ninja 

  • Thanks chewbika 

    There is a ticket raised with the engineering team regarding this issue. Once a fix is available, I'll comment back here.

  • Hi chewbika,

    The `export-spaces` file is not expected to be imported into SwaggerHub. This is only relevant within the context of the Explore tool.

    If you can share your space with me I'll take a look to see why the import to SwaggerHub is not working.

    Options:

    Via the GUI of Explore, navigate to `spaces`, click on the 3 dots of the space you want to expore, click `share snapshot`. You can send me the link.

    Alternatively, past in the full export-spaces file (redacting any auth or server info) here.

  • chewbika's avatar
    chewbika
    Occasional Contributor

    I took the json file from export-spaces and import it in SwaggerHub using the web GUI.

    However, we noticed the imported OAS has 1) extra layers of spaces-related fields before  and after paths and 2) within paths, there is no responses included. We wanted to confirm this is the expected behaviour of the export-spaces then import via SwaggerHub.

    The SwaggerHub Explore's spaces with the postman is going to help cut-time on the documentation time tremendously. I wanted to check if I missed a step before I get too deep into the process. Ty.

    exploreSpaces:
      - id: 66465971-e5b6-41ac-8025-xxxx
        name: Okos
        apis:
          - connections:
              - id: 6ba1c3d2-2993-41fb-95c2-xxxx
                type: null
                name: REST
                schema: OpenAPI
                schemaVersion: 3.0.1
                connectionDefinition:
                  openapi: 3.0.0
                  servers:
                    - url: https://{removed}
                        responses: []
                        parameters:
                          - in: header
                            name: Content-Type
                            schema:
                              type: string
                            examples:
                              example:
                                value: application/json
  • Hi zx11ninja 

    Are you able to view any information already in SwaggerHub via the SwaggerHub option in the left menu pane of Explore?

    If your integration with SwaggerHub looks good, the perhaps you could 'export' your space using the Explore.CLI (https://www.nuget.org/packages/Explore.Cli) and attach it here?

    • chewbika's avatar
      chewbika
      Occasional Contributor

      Morning frankkilcommins , i am facing the same issue now as the "export API to SwaggerHub" button consistantly returns 500. I see the API in SwaggerHub tab.

      Has this been fixed? or is the recommended approach just to use ExploreCLI? Ty

      Also, I notice I am getting quite a few websocket err logs even though I am not using any local API. Not sure if this may be related to 500 response code issue.

       

  • zx11ninja's avatar
    zx11ninja
    New Contributor

    Hi all.

    Additionally, I have created all of my HTTP requests and saved them in my space.  The last part is to export to SwaggerHub so that I can create an OAS file.

    Thoughts?

    Take care.

    -Z