fabioformosa / quartz-manager

REST API and UI Console Manager for Quartz Scheduler. This is a Java Library & UI embeddable single page app, to control and monitor jobs scheduled with Quartz Scheduler
Apache License 2.0
232 stars 84 forks source link

Backend Validation Messages: Customization and interoperability with host projects #79

Open fabioformosa opened 1 year ago

fabioformosa commented 1 year ago

At the moment, in case of validation errors, a bad request code is returned and a default error message in the response body. It's possible to customize the error response body. Take care that the customization doesn't override the customization applied by the project which imports quartz-manager (host project)

fabioformosa commented 1 year ago

Currently the api caller gets

"message": "Validation failed for object='simpleTriggerInputDTO'. Error count: 1",
  "errors": [
    {
      "codes": [
        "ValidRepetition.simpleTriggerInputDTO",
        "ValidRepetition"
      ],
      "arguments": [
        {
          "codes": [
            "simpleTriggerInputDTO.",
            ""
          ],
          "arguments": null,
          "defaultMessage": "",
          "code": ""
        }
      ],
      "defaultMessage": "Invalid repetition values",
      "objectName": "simpleTriggerInputDTO",
      "code": "ValidRepetition"
    }
  ],