Closed 4lejandrito closed 11 years ago
May I suggest you switch to 1.3.0-SNAPSHOT, which allows strong-typing of the response classes and a much better model introspecter? You can grab the snapshot source from here:
https://github.com/wordnik/swagger-core/tree/develop-1.3
a java example is here:
https://github.com/wordnik/swagger-core/tree/develop-1.3/samples/java-jaxrs
and snapshots are in sonatype oss:
Thank you very much, I will try it tomorrow.
Hello again :)
I have tried to update to 1.3.0-SNAPSHOT as follows:
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.9.1</artifactId>
<version>1.3.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
I have changed every annotation to its new name (ApiResponses, ApiModel, etc...) but I have the following problems:
Nevertheless, thank you for your help. I am looking forward to seeing a 1.3.0 official release with all my needs solved :)
Yes, jersey is now a transitive dependency, so you can update the jersey version as you like. If you don't want to do that, you can simply use the jersey-specific version. Otherwise, you'll have to include them yourself.
Can you give more detail with your ApiParam issue? I'm not quite sure I understand the issue.
Some weeks ago I posted #206 issue. It happened to be related to #52 so I suppose you solved it when solving #52. If you read #206 again, I believe you will understand my problems.
Thanks!!
PS: What do you mean with: jersey-specific version?
Are you sure there's an issue still? I just added this test:
https://github.com/wordnik/swagger-core/commit/29034cc6c5092389900245c6b50de2351f27c764
Against the current code, having a @PathParam in the class-level and it passes fine, per #52. Perhaps you have it configured differently?
swagger-jaxrs uses Jersey as a provided dependency so you technically don't have to use it (although most people do). There is one that is bound to jersey here:
https://github.com/wordnik/swagger-core/tree/develop-1.3/modules/swagger-jersey-jaxrs
which has some additional jersey-specific features, like supporting file uploads, etc.
HI, I already knew about that test, but I do not see why it is passing.
I have a field annotated with @ApiParam
but it does not compile because of the annotation's target.
In the source file from ApiParam:
I can see that the annotation's target is still ElementType.PARAMETER
. If you see the commit I made in my fork to workaround the problem (0f1501e307df219ab7bfa921400e178b6d89b87d) I had to change the annotation's target to {ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD}
(maybe METHOD does not make much sense, but FIELD is the important value).
I must be misunderstanding something.
I would appreciate your help.
I will do another test with this as a Java resource, there could be some scala magic happening. You can look at it as well to see if it's in-line with your code as well.
Well why didn't you say it was that easy! Fixed, it was the case that scala + java were handling the field differently. A new snapshot will be uploaded shortly.
Yes, It works now!!, but...
I would not say this issue is solved... You have completely solved #52 but I am afraid #227 is not.
As I said in the first message, when swagger-uing a resource like this:
@ApiModel( value = "XDataAnswerRESTGetStatus", description = "This command allows to get different current status of the device")
public class XDataAnswerRESTGetStatus extends XDataAnswerREST {
@ApiModelProperty( required = true, value = "List of statuses", dataType = "List[my.package.MyClass]")
public List<MyClass> statuses = new ArrayList<MyClass>();
...
}
I can see something like this:
XDataAnswerRESTGetStatus {
statuses (List[MyClass], optional):List of statuses
}
But MyClass
is not documented below as I expected.
:(
Hi, I have a Jersey Web Service which returns a JSON object containing an array of another JSON strucutre as follows:
Using Swagger-ui the class "MyClass" does not get documented. Is there any way to solve this?
Thanks in advance,
Alex