function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Norm_1Norm_1 

REST Return Type

I have an Apex class that can be invoked from a REST Get :

 

@HttpGet

global static Set<Id> doGet() {

.......

}

 

However the compiler is complaining with:

Invalid type for Http* method: SET<Id>

 

Am I only allowed to return a concrete object type?

Nick00000Nick00000

Yes this is mentioned in the Apex documenation in the section "Apex REST Methods"

 

You can't use a Set, but you can use a List instead.