-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Feat: add notNullable property for processor properties #3342
Conversation
f990748
to
d514bb8
Compare
Thanks a lot for the proposal. The idea is interesting, but it does not make the log more useful. I would propose to invert the annotation nullable -> notNullable. If notNullable==true and properti is null we throw a SpoonException. WDYT? |
ping @vmassol |
I think it's not the role of the spoon framework to handle that and that's the job of the Processor to tell what it needs and to report when it doesn't get what it needs to work (by throwing an exception if a property is mandatory and it cannot work without a value for it). |
@monperrus but wouldn't your change break the old behavior? If a user updates and gets your version, he could get exceptions for code working before. @vmassol Your message reads like you would remove the log message completely, would the proposed change still fit your needs? |
Yes I'd remove it completely and let the processor do the validation.
Sure. |
No, it's fully backward compatible if properties are still nullable by default. |
Changed nullable -> notNullable and added the SpoonException. Should we still write into the log, even if there is a exception thrown? |
Great.
no could you add the with that, we'll go towards merge thanks! |
github seems to have some problems, but the CI looks green. |
See #3339 for discussion why. I would add a simple boolean field to the property annotation because:
Maybe a open issue issue is where to document it?
Edit: need to fix git sry
Edit2: git fixed