Hello
I use the latest version of swagger-tools(0.10.1).
My swagger.yaml config:
swagger: "2.0"
info:
version: "0.1.0"
title: test API
basePath: /
paths:
/test:
x-swagger-router-controller: test
get:
operationId: operation
responses:
"200":
description: "success"
schema:
type: array
items:
type: string
if I return in the test operation array of numbers in string representation, for example ["123"], swagger-tools shows an error: Error: Response validation failed: failed schema validation.
It seems that here https://github.com/apigee-127/swagger-tools/blob/master/middleware/swagger-validator.js#L116 swagger-tools converts the array elements to numbers.
Code of my controller(test.js):
exports.operation = function(res, res) {
res.json(["123"]);
};