-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Don't require multi_json and multi_xml. #1623
Conversation
@namusyaka How do we feel about this? |
Json = ::JSON | ||
Json::ParseError = Json::ParserError | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to declare require 'json'
explicitly instead of trying to require it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean exactly? That the user has to require 'multi_json'
explicitly instead of trying to require and catch LoadError
here? That's a bit tricky because that forces you to include multi_json
before Grape, doesn't it?
else | ||
Xml = ::ActiveSupport::XmlMini | ||
Xml::ParseError = StandardError | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, I'd like to declare require 'active_support/xml_mini'
explicitly.
At the moment we don't declare require 'active_support'
itself, so autoload
won't be worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are you saying that I should add require 'active_support/xml_mini'
here after else
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Do I understand things correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, take a look at the PR as now, any issues? Thank you.
Sorry for the delay. I strongly agree with the purpose of this pull request. |
ddf5f89
to
eac8dab
Compare
@namusyaka I made the change that requires you to require multi_* manually. If you care to take a look? I'm going to merge soon. |
👍 👍 👍 |
Thank you for your great work! 🎉 |
I think we need to add explicit configuration to this and tests that use different json and xml libraries.