-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Hi,
I'm giving APISmith::Smash a try to map a rich JSON input to Ruby objects.
I have a situation where I have a nested piece of data that I want to map, but not some of its parents.
data = {
article: {
titleOfTheArticle: "My Title",
authorList: {
author: {
name: "John Doe"
}
},
details: {
status: "published"
updatedAt: '2013-05-10'
}
}
}
class Author < APISmith::Smash
property :name
end
class Article < APISmith::Smash
property :title, :from => :titleOfTheArticle
property :author, :transformer => Author
property :updated_at
endHere we can see that
- there is a nested
AuthorinArticleand we do not need to keep theauthorListintermediate - the
updated_atvalue, nested insidedetailswould be mapped directly intoArticle.
Are such things doable with APISmith, or I have to maintain all the hierarchy with classes?
Thanks
giridhar
Metadata
Metadata
Assignees
Labels
No labels