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

Support property attributes: nonnull and nullable #521

Closed
Ashton-W opened this issue May 19, 2015 · 3 comments
Closed

Support property attributes: nonnull and nullable #521

Ashton-W opened this issue May 19, 2015 · 3 comments

Comments

@Ashton-W
Copy link

Should Mantle support validation based on the new property attributes nonnull and nullable
Read about them here

@property (copy, nullable) NSString *name;
@property (copy, readonly, nonnull) NSArray *allItems;

Assuming they are available in the runtime, should Mantle use them to inform the validation of models? The checks these attributes add are at compile time, so have no effect on Mantle's KVC powered features.

@jspahrsummers
Copy link
Member

I'm pretty sure these are not available at runtime. Even if they were, Mantle doesn't perform much automatic validation—most of that is up to your model.

@Ashton-W
Copy link
Author

That is true, it is up to you to add Key-Value Validation methods to your model. This doesn't exactly fall under the JSON checks.
Maybe this could be changed to an enhancement for validation helper methods in Mantle. Which if possible, would include checking nullability.

Currently, writing the Key-Value Validation methods is a drag.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants