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

Serialiser_Engine: FromJson() to Trim the text before attempting to read it #3110

Merged

Conversation

alelom
Copy link
Member

@alelom alelom commented Jul 18, 2023

Issues addressed by this PR

Closes #3109

The json text is trimmed before attempting to read it. See #3109 for a longer description.

This helps solving issues reading files with trailing/initial newlines/whitespaces, in particular for workflows that @pawelbaran highlighted in BHoM/File_Toolkit#161 (if you go there, make sure you read its closing comment BHoM/File_Toolkit#161 (comment)).

Test files

Attached in #3109.

Changelog

Additional comments

@alelom alelom added the type:bug Error or unexpected behaviour label Jul 18, 2023
@alelom alelom self-assigned this Jul 18, 2023
@alelom alelom requested a review from pawelbaran July 18, 2023 15:43
@FraserGreenroyd FraserGreenroyd changed the title Serializer_Engine: FromJson() to Trim the text before attempting to read it Serialiser_Engine: FromJson() to Trim the text before attempting to read it Jul 18, 2023
Copy link
Member

@adecler adecler left a comment

Choose a reason for hiding this comment

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

Gets the job done so happy to approve.

Note: I have only done a review based on the code but this PR is simple enough that I am confident it works and doesn't break anything.

Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a comment

Choose a reason for hiding this comment

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

Code changes make sense based on the issue described, happy to approve for merge and testing via alphas.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check compliance
@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 19, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

There are 19 requests in the queue ahead of you.

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 19, 2023

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 19, 2023

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 19, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check ready-to-merge

There are 1 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot this is a DevOps instruction. I am requesting neutral checks on: unit-tests

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 19, 2023

@FraserGreenroyd I have provided neutral checks to the checks requested. These checks will need to be run properly to obtain full results.

@FraserGreenroyd FraserGreenroyd merged commit c0ae917 into develop Jul 19, 2023
@FraserGreenroyd FraserGreenroyd deleted the Serializer_Engine-#3109-trimJsonBeforeReading branch July 19, 2023 10:04
@bhombot-ci bhombot-ci bot mentioned this pull request Sep 11, 2023
@bhombot-ci bhombot-ci bot mentioned this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serializer_Engine: FromJson should first Trim the text before attempting to use it
3 participants