Skip to content

Explicitly Require JSON Library#444

Merged
lessthanjacob merged 1 commit intomainfrom
js/require-json-explicitly
Jul 19, 2024
Merged

Explicitly Require JSON Library#444
lessthanjacob merged 1 commit intomainfrom
js/require-json-explicitly

Conversation

@lessthanjacob
Copy link
Copy Markdown
Contributor

@lessthanjacob lessthanjacob commented Jul 18, 2024

Checklist:

  • I have updated the necessary documentation
  • I have signed off all my commits as required by DCO
  • My build is green

Background

Fixes #443

There's been a longstanding implicit dependency on the standard json library, as Blueprinter::Configuration requires it to be available in the case where a separate JSON library isn't specified on configuration. This hasn't caused many issues in the past, as most use cases for Blueprinter are in environments where json is loaded (e.g. a Rails application).

However, this is a brittle dependency, and if we're explicitly defining a default, we should make sure it's available in the confines of the class that needs it.

Changelog

  • Explicitly require 'json' within Blueprinter::Configuration.
  • Remove require 'json' from specs.

Signed-off-by: Jacob Sheehy <jacobjsheehy@gmail.com>
Copy link
Copy Markdown
Contributor

@jhollinger jhollinger left a comment

Choose a reason for hiding this comment

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

👍

@lessthanjacob lessthanjacob merged commit 2745cdb into main Jul 19, 2024
@lessthanjacob lessthanjacob deleted the js/require-json-explicitly branch July 19, 2024 03:59
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.

[bug] Can't use blueprinter outside of rails with ActiveModels

2 participants