eclipse-ee4j / eclipse-ee4j/jersey
Path containing spaces must be encoded in the WADL
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
If you have a REST resource with a @Path annotation containing spaces e.g., @Path("Say Hello"), the WADL does not encode the spaces.
Quoting from the JAXRS 2.0 spec,
The value of the annotation is automatically encoded, e.g. the following two lines are equivalent:
1 @Path("widget list/{id}")
2 @Path("widget%20list/{id}")
The WADL should show the encoded value or handle encoding. Currently, if we pick the space-included URL from the WADL and feed it into SOAPUI or other REST testing tools, we get 404 Not Found Error.
If user manually adds the encoding character like Say%20Hello, it works.
Example service:
```
@Path("project1")
public class GenericResource {
public GenericResource() {
}
@GET
@Produces("text/plain")
@Path("Say Hello")
public String getData() {
return "Hello";
}
}
```
Snippet of WADL for above service:
```
:
:
```
#### Environment
Windows 7
#### Affected Versions
[2.4.1]
Contributor guide
Assessment
This issue has not been assessed yet.