Skip to content

Treat Kotlin nullable as non-required - #1242

Closed
sdeleuze wants to merge 2 commits into
spring-projects:masterfrom
sdeleuze:SPR-14165
Closed

sdeleuze wants to merge 2 commits into
spring-projects:masterfrom
sdeleuze:SPR-14165

Conversation

@sdeleuze

@sdeleuze sdeleuze commented Nov 21, 2016 •

Copy link
Copy Markdown
Contributor

Superseeds #1060

@jhoeller Could you please review the polished version of this pull request, since this is the first time we introduce Kotlin code in our unit tests and since it adds a new Optional<Boolean> MethodParameter#isNullable() method that I would like to validate with you?

Issue: https://jira.spring.io/browse/SPR-14165

Where `isOptional` is used, also check for `isNullable` i.e.
values are not considered required if they are Kotlin nullables:
- spring-messaging: named value method arguments
- spring-web: named value method arguments
- spring-webmvc: request parts

This means that Kotlin client code no longer has to explicity specify
"required=false" for Kotlin nullables -- this information is inferred
automatically by the framework.

Issue: SPR-14165
@sdeleuze
sdeleuze force-pushed the SPR-14165 branch 3 times, most recently from eacb6ba to 2fcd86f Compare November 24, 2016 16:11
This commit polishes Kotlin nullable support by reusing
MethodParameter#isOptional() instead of adding a new
MethodParameter#isNullable() method, adds
Kotlin tests and introduces Spring Web Reactive
support.

Issue: SPR-14165
@sdeleuze

Copy link
Copy Markdown
Contributor Author

I merged a refactored version that reuses MethodParameter#isOptional(), with more tests and polish.

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.

2 participants