Import NSwag file


#1

Hi,

We’re trying to import a very simple code and we always get the following error:

  • Error(s) parsing the JSON for your API specification at the following paths:Please ensure that your file includes all of the required properties and values.

The json file we’re trying to import is:

{
  "x-generator": "NSwag v12.0.0.0 (NJsonSchema v9.12.2.0 (Newtonsoft.Json v11.0.0.0))",
  "swagger": "2.0",
  "info": {
    "title": "TEST API",
    "contact": {
      "name": "Company",
      "url": "http://url.com",
      "email": "email@email.com"
    },
    "version": "v1"
  },
  "host": "localhost:5000",
  "basePath": "/",
  "schemes": [
    "http"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/ping": {
      "get": {
        "tags": [
          "Login"
        ],
        "operationId": "Login_Ping",
        "responses": {
          "200": {
            "description": ""
          },
          "500": {
            "description": ""
          }
        }
      }
    }
  },
  "definitions": {}
}

Can someone provide some help on this issue?

Thanks,
Humberto


#2

Hi Humberto, when I try uploading this it imports into Dropsource with no errors so am wondering if there’s something wrong with your file encoding or something… I just pasted your text into a file and saved it with .json extension so could you try that and attempt uploading again?