ebowman / api-first-hand

API-First bootstrapping tool for building RESTful web services from a Swagger/OpenAPI spec
MIT License
142 stars 22 forks source link

Validation messages translations #81

Closed s12v closed 7 years ago

s12v commented 7 years ago

Attempt to translate validation messages using Play i18n

At the moment, validation messages are not very helpful:

[
  {
    "messages": [
      "error.maxLength"
    ],
    "args": [
      "2"
    ]
  }
]

This PR changes it to:

{
  "errors": [
    {
      "reference": "⌿definitions⌿VendorQuery⌿language",
      "message": "Maximum length is 2"
    }
  ]
}

TODO:

@slavaschmidt, @gipeshka, what do you think?

slavaschmidt commented 7 years ago

Looks good 👍

s12v commented 7 years ago

@slavaschmidt, docs updated, ready for review

s12v commented 7 years ago

@slavaschmidt, maybe we can have 0.3.0 for this? It's not a big change, but the validation response format has been changed.

slavaschmidt commented 7 years ago

Let's make it 0.2.3

The change from 0.2 to 0.3 would be something big, like breaking change with play 2.5 support for 0.2