Skip to content

Conversation

@sofyalaski
Copy link
Member

@sofyalaski sofyalaski commented Sep 4, 2025

Description

Introduces a try-catch block for parsing passed filter as a json string, and when that fails it throws an error . Before it was failing with 500 "internal server error"

Motivation

#2172

Fixes

  • Bug fixed (#X)

Changes:

  • changes made

Tests included

  • Included for each change/fix?
  • Passing?

Documentation

  • swagger documentation updated (required for API changes)
  • official documentation updated

official documentation info

@sofyalaski sofyalaski changed the title fix(filter-validation-pipe): throw an error when malformed json is passed fix(pipe): throw an error when malformed json is passed Sep 4, 2025
@sofyalaski sofyalaski changed the title fix(pipe): throw an error when malformed json is passed fix(pipe): throw an error when malformed json is passed Sep 4, 2025
@sofyalaski sofyalaski marked this pull request as ready for review September 4, 2025 10:54
@sofyalaski sofyalaski requested a review from HayenNico September 4, 2025 10:54
Copy link
Member

@HayenNico HayenNico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but will only cover API v4 right now. #2172 indicates a similar fix is needed on the v3 controller. I think the same logic could be inserted in DatasetsController.getFilters

@nitrosx
Copy link
Member

nitrosx commented Sep 4, 2025

@HayenNico you are correct

@bpedersen2
Copy link
Contributor

And keep in mind possible interactions with #1926

@sofyalaski sofyalaski merged commit 51c0765 into SciCatProject:master Sep 9, 2025
13 checks passed
@sofyalaski sofyalaski deleted the 2172-jsonLint branch September 9, 2025 12:43
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.

4 participants