3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apex REST コールアウトのtrailチェックがバグってる件

Last updated at Posted at 2019-08-22

Apex REST コールアウト

The 'getAnimalNameById' method must call https://th-apex-http-callout.herokuapp.com/animals/:id, using the ID passed into the method. The method returns the value of the 'name' property (i.e., the animal name).

とあるように、エンドポイントの指定は指示通りにするとこんな風になる。
request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/:id');
idの指定はシンボルで行っていて、これで問題ないはずなのに(実際Apexのテストも通る)
trailのチェックではじかれる。

Executing the 'getAnimalNameById' method on 'AnimalLocator' failed. Make sure the method exists with the name 'getAnimalNameById', is public and static, accepts an Integer and returns a String.

こんなメッセージが出力される。

回避するためには文字列結合を使う必要がある。
request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/'+id);
DiscussionForumより

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?