You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it stands now with Plank, you can define the success property easily within one model, but the dictionaries in the response leave you with either having to use a Map type (which more or less kills the power of Plank for me as I don't want to do something like errorModel[@"details"][@"error"]) or create another model to reference for erroranddetails. Creating another model gives me the type safety I'm after, but at the same time it's also time consuming and a bit overkill.
It'd be create if we define properties by keying them via the dictionary like Mantle allows, something like this for the example above:
Definitely not possible with plank today but this is approaching a more generalized way to have simpler concrete types defined alongside the parent type
This does seem convenient but if we did this I would imagine we could just inline the definition of the new schema vs putting it in a separate file. Thoughts?
Take this simple JSON response:
As it stands now with Plank, you can define the
success
property easily within one model, but the dictionaries in the response leave you with either having to use a Map type (which more or less kills the power of Plank for me as I don't want to do something likeerrorModel[@"details"][@"error"]
) or create another model to reference forerror
anddetails
. Creating another model gives me the type safety I'm after, but at the same time it's also time consuming and a bit overkill.It'd be create if we define properties by keying them via the dictionary like Mantle allows, something like this for the example above:
}
Unless I'm missing something, I don't think that's possible today with Plank. Either way, keep up the great work!
The text was updated successfully, but these errors were encountered: