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

Don't require multi_json and multi_xml. #1623

Merged
merged 3 commits into from
Jun 14, 2017

Conversation

dblock
Copy link
Member

@dblock dblock commented May 2, 2017

I think we need to add explicit configuration to this and tests that use different json and xml libraries.

@dblock
Copy link
Member Author

dblock commented May 2, 2017

@namusyaka How do we feel about this?

Json = ::JSON
Json::ParseError = Json::ParserError
end
end
Copy link
Contributor

@namusyaka namusyaka Jun 9, 2017

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.

Copy link
Member Author

@dblock dblock Jun 12, 2017

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
Copy link
Contributor

@namusyaka namusyaka Jun 9, 2017

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.

Copy link
Member Author

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?

Copy link
Contributor

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?

Copy link
Member Author

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.

@namusyaka
Copy link
Contributor

Sorry for the delay. I strongly agree with the purpose of this pull request.
Thank you!

@dblock dblock force-pushed the mutli-json-xml branch 2 times, most recently from ddf5f89 to eac8dab Compare June 13, 2017 15:59
@dblock dblock changed the title [WIP] Don't require multi_json and multi_xml. Don't require multi_json and multi_xml. Jun 13, 2017
@dblock
Copy link
Member Author

dblock commented Jun 13, 2017

@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.

@namusyaka
Copy link
Contributor

👍 👍 👍

@dblock dblock merged commit 53aeee9 into ruby-grape:master Jun 14, 2017
@namusyaka
Copy link
Contributor

Thank you for your great work! 🎉

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.

None yet

2 participants