Skip to content

Commit 2bd7ce1

Browse files
committed
Update Velocity template to handle resources when security is set to 'None'
1 parent 0b5d5e8 commit 2bd7ce1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

modules/distribution/resources/api_templates/velocity_template.xml

+12-3
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,18 @@ $in_sequences.get("$resource.getUriTemplate()").get($uri)
335335
</then>
336336
<else>
337337
#if( $environmentType !='hybrid' )
338+
#if( $resource.getAuthType() == 'None' && $environmentType == 'sandbox'
339+
&& $endpoint_config.get("sandbox_endpoints") )
340+
#draw_endpoint( "sandbox" $endpoint_config )
341+
#else
338342
<payloadFactory>
339343
<format>
340344
<error xmlns="">
341-
#if( $environmentType == 'production' )
345+
#if( $environmentType == 'production' )
342346
<message>Sandbox Key Provided for Production Gateway</message>
343-
#elseif( $environmentType == 'sandbox' )
347+
#elseif( $environmentType == 'sandbox' )
344348
<message>Production Key Provided for Sandbox Gateway</message>
345-
#end
349+
#end
346350
</error>
347351
</format>
348352
</payloadFactory>
@@ -352,14 +356,19 @@ $in_sequences.get("$resource.getUriTemplate()").get($uri)
352356
<property name="HTTP_SC" value="401" scope="axis2"/>
353357
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
354358
<send/>
359+
#end
355360
#else
356361
#if( $endpoint_config.get("production_endpoints")
357362
&& $endpoint_config.get("sandbox_endpoints") )
358363
#draw_endpoint( "sandbox" $endpoint_config )
359364
#elseif( $endpoint_config.get("production_endpoints") )
360365
<sequence key="_sandbox_key_error_"/>
361366
#elseif( $endpoint_config.get("sandbox_endpoints") )
367+
#if( $resource.getAuthType() == 'None' )
368+
#draw_endpoint( "sandbox" $endpoint_config )
369+
#else
362370
<sequence key="_production_key_error_"/>
371+
#end
363372
#end
364373
#end
365374
</else>

0 commit comments

Comments
 (0)