Closed
Description
openedon Mar 24, 2016
Haven't tested if validation fails for other fields, but at least for the paths field the extension "x-vendor-testy" causes validation to fail:
{
"swagger": "2.0",
"info": {
"version": "2.0",
"title": "My web service",
"description": "No description provided.",
"x-endpoint-name": "default"
},
"host": "dsw12.net:999",
"basePath": "/sandbox/8c88389038102937482abf83f8f/services/5b737fefc19b3047ab4f3234cd34642df2",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/swagger.json": {
"get": {
"summary": "Get swagger API document for the web service",
"operationId": "getSwaggerDocument",
"parameters": [
{
"name": "api-version",
"in": "query",
"description": "API version",
"required": false,
"type": "string",
"default": "2.0",
"enum": [
"2.0"
]
}
],
"responses": {
"200": {
"description": "Swagger API document for this service"
}
}
}
},
"x-vendor-testy" : "asd"
}
}
I get Error parsing swagger file. Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path 'paths.x-vendor-testy', line 45, position 29.
According to http://swagger.io/specification/#pathsObject and I spoke with some people on the swagger IRC channel, this is valid swagger:
npm install -g swagger-tools && swagger-tools validate "http://pastebin.com/raw/8LWmz7zp" --verbose
I guess this means if vendors do specify extensions to the schema, they can't use autoRest - I think you should ignore them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels