-
-
Notifications
You must be signed in to change notification settings - Fork 114
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 placeholder at apiReturnListType and apiReturnType #1200
support placeholder at apiReturnListType and apiReturnType #1200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matsudamper the approach looks good to me. Can you please fix a minor comment I have in Java/Kotlin/Scala mappers and we should be good to merge this. Thanks
return computedTypeName.replace(JAVA_UTIL_LIST, mappingContext.getApiReturnListType()); | ||
if (mappingContext.getApiReturnListType().contains(MappingConfigConstants.API_RETURN_NAME_PLACEHOLDER)) { | ||
Matcher matcher = JAVA_UTIL_LIST_ELEMENT_REGEX.matcher(computedTypeName); | ||
matcher.find(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matsudamper I think it's better if you do if (matcher.find()) { ... }
boolean isNullable = computedTypeName.endsWith(KOTLIN_UTIL_NULLABLE); | ||
|
||
Matcher matcher = KOTLIN_UTIL_LIST_ELEMENT_REGEX.matcher(computedTypeName); | ||
matcher.find(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matsudamper I think it's better if you do if (matcher.find()) { ... }
return computedTypeName.replace(SCALA_UTIL_LIST, mappingContext.getApiReturnListType()); | ||
if (mappingContext.getApiReturnListType().contains(MappingConfigConstants.API_RETURN_NAME_PLACEHOLDER)) { | ||
Matcher matcher = SCALA_UTIL_LIST_ELEMENT_REGEX.matcher(computedTypeName); | ||
matcher.find(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matsudamper I think it's better if you do if (matcher.find()) { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented.
2542b8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Will include this feature in the next release. Thank you for the contribution!
Description
Related to #1167
Added placeholder support for apiReturnListType and apiReturnType.
The following syntax is supported.
Changes were made to: