Hello everyone!
I found REST API weird behavior while querying items from SharePoint list.
Here is the [Edit] column (came from base calendar type):
[Edit] field's SchemaXml contains this:
<Field ID="{503f1caa-358e-4918-9094-4a2cdc4bc034}" ReadOnly="TRUE" Type="Computed" Name="Edit" Sortable="FALSE" Filterable="FALSE" DisplayName="Edit" ClassInfo="Icon" AuthoringInfo="(link to edit item)" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Edit" FromBaseType="TRUE"><DisplayPattern><IfHasRights><RightsChoices><RightsGroup PermEditListItems="required" /></RightsChoices><Then><HTML><![CDATA[<a href="]]></HTML><URL Cmd="Edit" /><HTML><![CDATA[" onclick="EditLink(this, ]]></HTML><Counter Type="View" /><HTML><![CDATA[);return false;" target="_self">]]></HTML><HTML><![CDATA[<img border="0" alt="]]></HTML><HTML>Edit</HTML><HTML><![CDATA[" src="/_layouts/15/images/edititem.gif?rev=47"/>]]></HTML><HTML><![CDATA[</a>]]></HTML></Then><Else><HTML><![CDATA[ ]]></HTML></Else></IfHasRights></DisplayPattern></Field>
Here is the request for list items:
/_api/web/lists('7da4e267-2e9f-45bb-a343-4a4e7a4ece20')/items?$select=EventContact%2FID,EventContact%2FTitle,EventContact%2FName,EventContact%2FEMail,Speaker%2FID,Speaker%2FTitle,Speaker%2FName,Speaker%2FEMail,Edit&$expand=EventContact,Speaker&$top=300
EventContact and Speaker are User fields.
Here is the response [code: 400 Bad request]:
If i remove Edit from $select clause then REST API call finishes corect:
/_api/web/lists('7da4e267-2e9f-45bb-a343-4a4e7a4ece20')/items?$select=EventContact%2FID,EventContact%2FTitle,EventContact%2FName,EventContact%2FEMail,Speaker%2FID,Speaker%2FTitle,Speaker%2FName,Speaker%2FEMail&$expand=EventContact,Speaker&$top=300
If i remove both columns EventContact and Speaker from $select clause and from $expand clause then REST API call finishes corect:
/_api/web/lists('7da4e267-2e9f-45bb-a343-4a4e7a4ece20')/items?$select=Edit&$top=300
So, my question is: WHAT the freaking strange thing? Can anyone explain what rule affects this?