Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced errors schema for rich error display in deposit form #12

Open
slint opened this issue Mar 4, 2025 · 0 comments
Open

Enhanced errors schema for rich error display in deposit form #12

slint opened this issue Mar 4, 2025 · 0 comments

Comments

@slint
Copy link
Member

slint commented Mar 4, 2025

To display rich errors resulting from the configured checks, we need to extend the current schema of the errors key returned in draft REST API responses, so that it looks something like:

{
   ...
   "errors": [
       {
           "field": "metadata.funding",
           "messages": ["At least one EC-funded award should be present."],
           "severity": "info",  // failure, warning, info
           "context": {
               "community": "<community_id>",
               "check": "<check_id>",
           }
       },
       {
           "field": "metadata.creators",
           "messages": ["Authors must use persistent identifiers (ORCiD, GND, etc.). 'Nielse, Lars Holm' and 'Ioannidis, Alex' are missing ORCiDs."],
           "severity": "warning",  // failure, warning, info
           "context": {
               "community": "<community_id>",
               "check": "<check_id>",
           }
       }
   ],

   ...
   "ui": {
      "communities": {
          "<community_id>": {...slug, title, etc...},
      },
      "checks": {
          "<check_id>": {...title, links, description, etc...},
      } 
   }
}
@slint slint changed the title Define enhanced errors schema for displaying rich errors/warnings/suggestions in the deposit form Enhanced errors schema for rich error display in deposit form Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant