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

ForceNullable on Class/Interface Level #14

Closed
schwamster opened this issue Aug 25, 2016 · 3 comments
Closed

ForceNullable on Class/Interface Level #14

schwamster opened this issue Aug 25, 2016 · 3 comments

Comments

@schwamster
Copy link

I would like to use the ForceNullable Attribute on Class/Interface Level so that all Properties of the Class/Interface are optional in the resulting ts.

=>
Forces all properties to be nullable. E.g. field:boolean becomes field?:boolean when you specify [TsInterface(ForceNullable = true)] in attribute configuration

Is that something that could be interesting to others?

@pavel-b-novikov
Copy link
Member

You can do almost the same thing using fluent configuration already - so you can specify

.With*Properties(c=>c.ForceNullable());

I'm not sure that it is necessary to add it to attributes configuration because it may be confusing when you have already specified ForceNullable for all the properties and then you suddenly decided to make one/two/three properties not nullable. Now it is much more flexible to use fluent configuration for that, but if someone else is interested then I can implement.

@schwamster
Copy link
Author

thanks for that snippet. I have to admit i did not check out the fluent configuration yet.
works great and this suits me much better than attribute configuration anyways.

@pavel-b-novikov
Copy link
Member

pavel-b-novikov commented Aug 25, 2016

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

No branches or pull requests

2 participants