Skip to content

Don't generate properties marked with json ignore attribute #13

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

Merged

Conversation

mbrizic
Copy link
Collaborator

@mbrizic mbrizic commented Jan 11, 2017

Fixes #11.

@@ -334,7 +334,7 @@ private List<MemberWithCSharpType> GetMembers(TypeDefinition typeDefinition)
});

var properties = typeDefinition.Properties
.Where(p => p.GetMethod != null && p.GetMethod.IsPublic && !p.IsSpecialName)
.Where(p => p.GetMethod != null && p.GetMethod.IsPublic && !p.IsSpecialName && !Helpers.HasCustomAttribute(p, "JsonIgnoreAttribute"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to have a config, something like:
"IgnorePropertiesWithAttributes" and then specify attributes - those properties with those attributes will be ignored?
Might be better than having a magic string

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, but I am fine with this being here for now, since it is the most occuring case, and we can figure out a scheme for enhanced attribute support/handling as a separate issue?

@greymind greymind merged commit 33b16cd into master Jan 11, 2017
@greymind greymind deleted the issue-11-dont-generate-properties-with-json-ignore-attribute branch January 25, 2019 13:00
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.

3 participants