{
"spec": {
"swagger": "2.0",
"info": {
"version": "v1",
"title": "Star.Web.Api"
},
"host": "localhost:5000",
"schemes": ["http"],
"paths": {
"/api/notifications/read": {
"put": {
"tags": ["Notifications"],
"summary": "Mark notifications as read",
"operationId": "Notifications_PutMultiRead",
"consumes": ["application/json", "text/json", "application/x-www-form-urlencoded"],
"produces": [],
"parameters": [{
"name": "ids",
"in": "body",
"description": "UID's of notifications",
"required": true,
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}],
"responses": {
"204": {
"description": "No Content"
}
},
"security": [{
"oauth2": []
}]
}
}
}
},
"options": {
"modelPropertyNaming":"camelCase",
"apiPackage":"app.webapi.api",
"modelPackage":"app.webapi.model"
}
}
If I change it to object or to constant, everything OK. For example:
Description
This problem appeared in v.2.2.3.
I'm trying to generate "typescript-angular2" client API with http://generator.swagger.io/#!/clients/generateClient service.
I cutted my configuration to make it more readable and it looks like this:
Such a description leads to an error:
{ "code": 1, "type": "error", "message": "Unable to build target: Could not generate api file for 'Notifications'" }That's because of the schema of my parameter:
If I change it to object or to constant, everything OK. For example:
The Swagger spec say's that such a schema for parameter is absoluty legal:
https://swagger.io/specification/#parameterIn (see example where body parameter is an array of string values)
Swagger-codegen version
2.2.3