Skip to content

Fix #1200 – JSON data/tag endpoint returns XML errors#1271

Open
agrim-rai wants to merge 1 commit intoopenml:developfrom
agrim-rai:fix-1200-json-endpoint-xml-error
Open

Fix #1200 – JSON data/tag endpoint returns XML errors#1271
agrim-rai wants to merge 1 commit intoopenml:developfrom
agrim-rai:fix-1200-json-endpoint-xml-error

Conversation

@agrim-rai
Copy link

Adds JSON error responses for API v1 endpoints. When clients request /api_new/v1/json/*, errors now return JSON instead of XML.

Solves #1200
Before :
image
After :
image

Changes

  • Added openml_OS/views/pages/api_new/v1/json/error-message.tpl.php to provide consistent JSON-formatted error responses.
  • New JSON error schema:
    {
      "error": {
        "code": "<code>",
        "message": "<message>",
        "additional_information": "<info>"
      }
    }

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

Successfully merging this pull request may close these issues.

1 participant