Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the different between io.swagger.annotations and com.wordnik.swagger.annotations

Tags:

swagger

I am new to swagger and found there are two packages for swagger annotation: io.swagger.annotations and com.wordnik.swagger.annotations. I wonder what the difference is between them and what I should use?

like image 219
Joey Yi Zhao Avatar asked Apr 01 '16 03:04

Joey Yi Zhao


People also ask

What is io Swagger annotations API?

Annotation Type Api. @Target(value=TYPE) @Retention(value=RUNTIME) @Inherited public @interface Api. Marks a class as a Swagger resource. By default, Swagger-Core will only include and introspect only classes that are annotated with @Api and will ignore other resources (JAX-RS endpoints, Servlets and so on).

What is @schema annotation in Swagger?

The annotation may be used to define a Schema for a set of elements of the OpenAPI spec, and/or to define additional properties for the schema. It is applicable e.g. to parameters, schema classes (aka "models"), properties of such models, request and response content, header.

What is Apioperation in Swagger?

Describes an operation or typically a HTTP method against a specific path. Operations with equivalent paths are grouped in a single Operation Object. A combination of a HTTP method and a path creates a unique operation.


1 Answers

The com.wordnik package is for the older swagger specifications, 1.x. As of swagger specification 2.0, the package is now io.swagger. The annotation signatures should be the same, just the package has changed.

like image 80
fehguy Avatar answered Sep 20 '22 10:09

fehguy