2

As per the Salesforce Article Winter / Spring '18 Apex Compiler Changes it is mentioned that

  • UrlMapping is NOT allowed for @HttpPost

  • UrlMapping and URL strings are NOT allowed for @HttpGet

but there is not any Suggested fix for that

Do anybody have an idea regarding this?

Thanks

3

urlMapping is meant to be used only on @RestResource (and is required). The notes specify that @HttpPost, for example, must not specify a urlMapping.


Valid

@RestResource(urlMapping='/someUrl/')
global class MappedClass {
  @HttpPost global static void doPost() {
  }
}

Invalid (But Previously Compiled)

@RestResource(urlMapping='/someUrl/')
global class MappedClass {
  @HttpPost(urlMapping='/someOtherUrl/')
  global static void doPost() {
  }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.