Fork me on GitHub
#ring-swagger
<
2017-05-31
>
ikitommi05:05:23

the new c-api validation errors might look something like this (as seen from the JSON client): OLD:

{
  "errors": {
    "name": "missing-required-key"
  }
}
NEW:
{
  "type": "compojure.api.exception/request-validation",
  "validation": "schema",
  "value": {
    "description": "string",
    "size": "L",
    "origin": {
      "country": "PO",
      "city": "string"
    }
  },
  "in": [
    "request",
    "body-params"
  ],
  "schema": {
    "name": "java.lang.String",
    "<#C1923ED97|schema>.core.OptionalKey{:k :description}": "java.lang.String",
    "size": [
      "enum",
      "L",
      "M",
      "S"
    ],
    "origin": {
      "country": [
        "enum",
        "PO",
        "FI"
      ],
      "city": "java.lang.String"
    }
  },
  "errors": {
    "name": "missing-required-key"
  }
}