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

Explicitly Require JSON Library #444

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

lessthanjacob
Copy link
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.

Copy link
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
8 checks passed
@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