-
Notifications
You must be signed in to change notification settings - Fork 615
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
SAVON 3 Use of Nori should include configurable nori options #543
Comments
Ditched the monkey patch in favor of a direct solution:
where next_message is a function I have to increment my message numebr
|
👍 on this. I don't want all my keys to be symbols. I'd like a way to configure Nori such that it only snake case's the keys, leaving them as strings. |
change the above code: element.each do |name,el|
new_element[name.to_s.camelcase.to_sym] = camelcase_keys(el)
end to element.each do |name,el|
new_element[name.to_s] = camelcase_keys(el)
end And you shall have that which you desired |
@ashrocket I think allowing users to set the Nori options for parsing the response is a reasonable request for Savon3. The method you laid out seems good, but I'd definitely want to get some tests for this behavior before merging anything in. Seems like a simple test where you pass in a Re: symbols, @proby, there's an outstanding issue in #473 to switch from symbols to strings to avoid a memory leak. Hoping to address that soon. |
Sure, I think we can add something like ActiveModel::Validator class Person
include ActiveModel::Validations
validates_with MyValidator
end
class MyValidator < ActiveModel::Validator
def validate(record)
if some_complex_logic
record.errors[:base] = "This record is invalid"
end
end
private
def some_complex_logic
# ...
end
end Only savon's api would require a method for convert convert_tags_to |
Though the change log current says that your are not using Nori, you are still using it
in the response. Unfortunately for me one of the cool elements of using the response header, in the request headers (for soap services that return a changing token in the Securtiy header) is not working since you default to snake_case on the symobls returned.
Can we get :
I'll be happy to fork it, but I'm terrible at writing rspec.
Or if this is undesirable (because you are referencing :envelope, and :body direectly in the response Object)
is there some otherway you recommend getting header elements into camelcase?
For now, I've monkeypatched Nori to camelcase anything inside
[:envelope][:header]
in my app using:symbol_name.to_s.camelcase.to_sym
The text was updated successfully, but these errors were encountered: