Closed
Description
Problem statement
Multiple validation errors are not being return in the json response.
Swagger specification
---
swagger: '2.0'
info:
version: "0.1.0"
title: Worlflow Signaler API
paths:
/capacity-change-events:
post:
description: Inform the signaler that resource capacity has changed
parameters:
- name: event
in: body
schema:
$ref: '#/definitions/CapacityChangeEvent'
required: true
responses:
200:
description: Successful response
/resource-change-events:
post:
description: Inform the signaler that resource capacity has changed
parameters:
- name: event
in: body
schema:
$ref: '#/definitions/ResourceChangeEvent'
required: true
responses:
200:
description: Successful response
produces:
- application/json
consumes:
- application/json
definitions:
CapacityChangeEvent:
type: object
properties:
customerID:
type: integer
description: ID of customer affected
capacityChange:
type: integer
description: the amount of capacity change
required:
- customerID
- capacityChange
ResourceChangeEvent:
type: object
properties:
cluster:
type: string
description: Cluster name that has new resource
resourceChange:
type: integer
description: the number of servers that have changed
required:
- cluster
- resourceChange
Steps to reproduce
Create an endpoint that accepts a POST
Create a model for the body of the POST with two required fields.
Send a post to that endpoint with no body.
Result
{
"code": 602,
"message": "cluster in body is required"
}
Expected it to return a "validation failure list" message from a CompositeValidationError
https://github.com/go-openapi/errors/blob/master/schema.go