On 15/07/2015 10:26, Sergey Beryozkin wrote:
Hi,
On 15/07/15 11:05, Francesco Chicchiriccò wrote:
On 14/07/2015 16:34, Sergey Beryozkin wrote:
Hi Francesco,
The generator checks which operations are the same path operations,
I've checked the code and it also compares a number of path and matrix
parameters, so PUT was also sharing the same root resource, before it
had a keyId method parameter.
If PUT where inside a keyId resource then the reverse generation would
produce a put method with a PathParam.
We can add a configuration option to make sure PUT ends up in the same
block with GET/DELETE, but as I mentioned that would imply a generated
Java PUT method would end up with PathParam - that can be done if you
prefer it
So basically the "problem" is the usage of @BeanParam for the PUT
method; I can probably improve our WADL2HTML to group together such
split resources.
I'm not seeing @BeanParam at
https://github.com/apache/syncope/blob/master/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
You're right! Since I could not remember why, I've just tested it again:
when using @BeanParam there - and in all similar methods from all other
services - I experiment that the actual payload is not sent by client at
all.
I think it is because no @PathParam is available in the signature (I
recall we discussed the idea so that the client does not have to put
null...) and this is why PUT is not sharing the same root, because if
it does share the same root then it would imply, at the generation
time that the method signature does need to have @PathParam.
To be honest I think the fact WADL requires template parameters being
defined at the resource but not method level is not very flexible
because it implies the inheritance for all the immediate method children.
It is very easy to update WADLGenerator to make sure it shares the
same root - if the reverse generation issue is not a real issue (which
can actually be the case), let me add the configuration option...
This would be nice indeed, thanks.
Regards.
On 14/07/15 10:46, Francesco Chicchiriccò wrote:
Hi all,
any obvious reason why two distinct resources with path "/{key}"
[1] are
generated from [2]?
TIA
Regards.
[1] https://paste.apache.org/lQbF
[2]
https://github.com/apache/syncope/blob/master/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/