tracker issue : CF-4197195

select a category, or use search below
(searches all categories and all time range)
Title:

Order of REST handlers affects accessibility

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Mosh Teitelbaum / Mosh Teitelbaum (Mosh Teitelbaum)

Created: 11/01/2016

Components: REST Services

Versions: 2016

Failure Type: Engineering Work Item

Found In Build/Fixed In Build: CF2016_Update3 /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 0

Problem Description:
In a CFC that defines REST endpoint handlers, the order in which the different functions are defined can affect ColdFusion's ability to process that endpoint/pattern.  Specifically, I have two cffunctions defined for the same endpoint and method, one without an additional restpath argument and one with.  If the one without the restpath argument is defined first, CF/jersey never seems to find the second handler.  If the order is swapped so that the handler with the additional restpath argument is defined first, both endpoints are accessible.


Steps to Reproduce:
<cfcomponent rest="true" restpath="/accounts" produces="application/json">
	<cffunction name="withoutId" access="remote" returntype="void" method="OPTIONS">
	</cffunction>

	<cffunction name="withId" access="remote" returntype="void" method="OPTIONS" restpath="{id}">
		<cfargument name="id" type="string" required="true" restargsource="Path" />
	</cffunction>
</cfcomponent>

Send HTTP Request as:
	OPTIONS /accounts/123 HTTP/1.1


Actual Result:
Jersey WADL and the withId() function is never called.


Expected Result:
The withId() function should be called.


Any Workarounds:
Place the withId() function definition before the definition of the withoutId() function.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4197195

External Customer Info:
External Company:  
External Customer Name: Mosh Teitelbaum
External Customer Email:  
External Test Config: My Hardware and Environment details:

ColdFusion 2016 Enterprise

Windows Server 2012

Attachments:

Comments: