<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Does ivy RestAPI require @Path on class body?</title><link>https://answers.axonivy.com/questions/3494/does-ivy-restapi-require-path-on-class-body</link><description>&lt;p&gt;Hi ivyteam&lt;/p&gt;
&lt;p&gt;I'm using ivy 7.0.3 to develop RestAPI.&lt;/p&gt;
&lt;p&gt;Now i have a api as below&lt;/p&gt;
&lt;p&gt;&lt;img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_o9lhxJr.png"&gt;
On the right side i define @Path on class body but the left side.&lt;/p&gt;
&lt;p&gt;The right it works well on designer and engine. The left only works for Designer. on engine it say restAPI not found (already restart ivy engine)&lt;/p&gt;
&lt;p&gt;Does ivy require @Path on class body?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3494/does-ivy-restapi-require-path-on-class-body" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 05 Nov 2018 09:09:36 -0500</lastBuildDate><item><title>Answer by Christian Strebel</title><link>https://answers.axonivy.com/questions/3494/does-ivy-restapi-require-path-on-class-body/3536</link><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes the Path annotation is needed at class level. This is defined in the JAX-RS standard. See 
&lt;a href="https://docs.oracle.com/cd/E19798-01/821-1841/6nmq2cp1v/index.html"&gt;Building RESTful Web Services with JAX-RS&lt;/a&gt; or &lt;a href="https://docs.oracle.com/javaee/7/api/javax/ws/rs/Path.html"&gt;@Path Java Doc&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I can not reproduce that this works without the path annotation on class level on a designer (7.0.8).
You could use an empty path at class level:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@Path("")
public class PersonServiceEmptyClassAnnotation {

    @GET
    @Path("person-empty")
    public String getPersonInfo() {
        return "info-empty";
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Strebel</dc:creator><pubDate>Mon, 05 Nov 2018 09:09:36 -0500</pubDate><guid>https://answers.axonivy.com/questions/3494/does-ivy-restapi-require-path-on-class-body/3536</guid></item></channel></rss>