Skip to content

Commit 0e48ed0

Browse files
committed
- fixes a bug where passing a non property would make the template fail
1 parent 5f0cf14 commit 0e48ed0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Templates/Java/requests_extensions/BaseEntityCollectionReferenceRequest.java.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import <#=mainNamespace#>.<#=c.GetPackagePrefix()#>.<#=c.TypeName()#>;
2727
super(requestUrl, client, requestOptions, <#=c.TypeCollectionResponse()#>.class, <#=c.ITypeCollectionPage()#>.class);
2828
}
2929

30-
public void post(final <#=c.TypeName()#> new<#=c.TypeName()#>, final ICallback<? super <#=c.TypeName()#>> callback) {
3130
<#
3231
var navigationProperty = c.AsOdcmProperty().GetServiceCollectionNavigationPropertyForPropertyType(((CustomT4Host)Host).CurrentModel);
3332
if (navigationProperty != null) {
@@ -39,6 +38,7 @@ import <#=mainNamespace#>.<#=c.GetPackagePrefix()#>.<#=c.TypeName()#>;
3938

4039
String prop = c.AsOdcmProperty().GetServiceCollectionNavigationPropertyForPropertyType(((CustomT4Host)Host).CurrentModel).Name;
4140
#>
41+
public void post(final <#=c.TypeName()#> new<#=c.TypeName()#>, final ICallback<? super <#=c.TypeName()#>> callback) {
4242
final String requestUrl = getBaseRequest().getRequestUrl().toString();
4343
final ReferenceRequestBody body = new ReferenceRequestBody(getBaseRequest().getClient().getServiceRoot() + "/<#=prop#>/<#=implicitNavigationProperty#>" + new<#=c.TypeName()#>.id);
4444
new <#=c.TypeWithReferencesRequestBuilder()#>(requestUrl, getBaseRequest().getClient(), /* Options */ null)

0 commit comments

Comments
 (0)