You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by "James Bognar (Jira)" <ji...@apache.org> on 2020/01/11 16:12:00 UTC

[jira] [Closed] (JUNEAU-177) Allow REST methods at specific paths to be overridden by methods in child classes.

     [ https://issues.apache.org/jira/browse/JUNEAU-177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Bognar closed JUNEAU-177.
-------------------------------
    Fix Version/s: 8.1.3
       Resolution: Fixed

> Allow REST methods at specific paths to be overridden by methods in child classes.
> ----------------------------------------------------------------------------------
>
>                 Key: JUNEAU-177
>                 URL: https://issues.apache.org/jira/browse/JUNEAU-177
>             Project: Juneau
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 8.1.2
>            Reporter: James Bognar
>            Priority: Major
>             Fix For: 8.1.3
>
>
> Currently you will get an exception if you try to duplicate paths in a class.
> Relax that restriction to allow you to override paths by child classes like so:
> {code:java}
> 	@Rest
> 	public static class B1 {
> 		@RestMethod(name=GET, path="/foo")
> 		public String b01a() {
> 			return "a";
> 		}
> 	}
> 	@Rest
> 	public static class B2 extends B1 {
> 		@RestMethod(name=GET, path="/foo")
> 		public String b02a() {  // Overrides method on parent.
> 			return "b";
> 		}
> 	}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)