Support Topics Documentation Slack YouTube Blog

Issue importing API definitions to create API endpoints

Hello,

I am getting an error no matter what format I upload my API definitions in.

I have tried Swagger 2.0, WSDL, WADL, etc. I am converting from a OpenAPI 3.0 definition (created in Stoplight Studio).

Thank you,
Kevin

Hi, @Kevin_Elliott

We’ll investigate this issue as soon as possible.

Regards,
Marina

Hello @Kevin_Elliott

I researched your Web-Backend-API.v1.json-Swagger20.json document.

Now we have the schema parameter required for the methods.
So I changed

      "put": {
        ...
        "operationId": "put-users-id",
        ...
        "parameters": [...],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {}
          }
        }
      }

to

      "put": {
        ...
        "operationId": "put-users-id",
        ...
        "parameters": [...],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            },
            "headers": {}
          }
        }
      }

I did the same for the 51st method.
Look and change, if necessary, to another type.
With my modifications, this problem is not reproducible.
Also I created a ticket to investigate and fix this issue globally (BKNDLSS-23264).

After fixing the problem related to the type of the scheme, another problem was discovered: we have the following criteria for the method name - the length of the name cannot be more than 45 characters and must only consist of alphabetic or numeric characters or the underscore.
If there is no "operationId" from swagger or it consists not only of alphabetic or numeric characters or an underscore, then we ourselves form this name based on the method type and path.
Let’s look at an example of a method with “operationId”: “get-meal_planner-voting-votes-id”: operationId contains the symbol - (hyphen), so we form a new name based on the method type and path, which will be - deleteHomeHome_idMeal_plannerVotingVotesVote_id, but, since the length of the generated method name is 47 characters, we cannot accept this name.
To avoid this, I renamed “get-meal_planner-voting-votes-id” to “get_meal_planner_voting_votes_id”. I did the same for the other 65 methods.

Also, I draw your attention to the fact that you need to change “host”: “localhost: 3101” to, “host”: "api.backendless.com"

I sent the modified swagger document to your mail.

Try, please, with the modified swagger document and write if everything worked out for you.