Hi, using service stack 5.0.2
given this dto
[Route("/persons/events/subCategories", “PUT”)]
public class SetEventPersonSubCategories
: IReturn
{
[ApiMember(IsRequired = true, ParameterType = “body”, Name = “subcategories”)]
public List Subcategories { get; set; }
//public SubCategoryWrite Subcategories { get; set; }
}
the generated schema is :
‘/persons/events/subCategories’:
put:
tags:
- persons
operationId: SetEventPersonSubCategoriespersonideventseventidsubCategories_Create
consumes:
- application/json
produces:
- application/json
*parameters:
- name: subcategories
in: body
type: array
items:
$ref: ‘#/definitions/SubCategoryWrite’
collectionFormat: multi
required: true
responses:
‘200’:
description: Success
schema:
$ref: ‘#/definitions/SetEventPersonSubCategoriesResponse’
deprecated: false
parameters:
- $ref: ‘#/parameters/Accept’
gives the following schema errors in https://editor.swagger.io/
Schema error at paths[’/persons/{personid}/events/{eventid}/subCategories’].put.parameters[0]
should NOT have additional properties
additionalProperty: type, items, collectionFormat, name, in, required
Jump to line 967
Schema error at paths[’/persons/{personid}/events/{eventid}/subCategories’].put.parameters[0].in
should be equal to one of the allowed values
allowedValues: header, formData, query, path
Jump to line 968
Schema error at paths[’/persons/{personid}/events/{eventid}/subCategories’].put.parameters[0].items
should NOT have additional properties
additionalProperty: $ref
Jump to line 970
Schema error at paths[’/persons/{personid}/events/{eventid}/subCategories’].put.parameters[0].collectionFormat
should be equal to one of the allowed values
allowedValues: csv, ssv, tsv, pipes
Jump to line 972
As you can see , there is something wrong with the array declaration ,
if I replace
public List Subcategories { get; set; }
with
public SubCategoryWrite Subcategories { get; set; }
it does not complain anymore
Can you please help ?