Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit d81edd3

Browse files
authored
Merge pull request #105 from swagger-api/ticket-2485
Versioning and naming - refs #2485
2 parents 4c074a4 + ed6093e commit d81edd3

21 files changed

+87
-56
lines changed

java/java-dropwizard/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22
<parent>
3-
<groupId>io.swagger</groupId>
3+
<groupId>io.swagger.samples.v3</groupId>
44
<artifactId>swagger-samples-project</artifactId>
55
<version>2.0.0</version>
66
<relativePath>../..</relativePath>
@@ -140,7 +140,7 @@
140140
<artifactId>dropwizard-core</artifactId>
141141
</dependency>
142142
<dependency>
143-
<groupId>io.swagger</groupId>
143+
<groupId>io.swagger.core.v3</groupId>
144144
<artifactId>swagger-jaxrs2</artifactId>
145145
<version>${swagger-version}</version>
146146
<scope>compile</scope>

java/java-dropwizard/src/main/java/io/swagger/sample/SwaggerSampleApplication.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import io.dropwizard.Application;
66
import io.dropwizard.setup.Bootstrap;
77
import io.dropwizard.setup.Environment;
8-
import io.swagger.jaxrs2.integration.resources.OpenApiResource;
9-
import io.swagger.oas.integration.SwaggerConfiguration;
10-
import io.swagger.oas.models.OpenAPI;
11-
import io.swagger.oas.models.info.Contact;
12-
import io.swagger.oas.models.info.Info;
13-
import io.swagger.oas.models.info.License;
8+
import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource;
9+
import io.swagger.v3.oas.integration.SwaggerConfiguration;
10+
import io.swagger.v3.oas.models.OpenAPI;
11+
import io.swagger.v3.oas.models.info.Contact;
12+
import io.swagger.v3.oas.models.info.Info;
13+
import io.swagger.v3.oas.models.info.License;
1414
import io.swagger.sample.resource.PetResource;
1515

1616
import java.util.stream.Collectors;

java/java-dropwizard/src/main/java/io/swagger/sample/model/Order.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.swagger.sample.model;
1818

19-
import io.swagger.oas.annotations.media.Schema;
19+
import io.swagger.v3.oas.annotations.media.Schema;
2020

2121
import java.util.Date;
2222

java/java-dropwizard/src/main/java/io/swagger/sample/model/Pet.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.swagger.sample.model;
1818

19-
import io.swagger.oas.annotations.media.Schema;
19+
import io.swagger.v3.oas.annotations.media.Schema;
2020

2121
import java.util.List;
2222
import java.util.ArrayList;

java/java-dropwizard/src/main/java/io/swagger/sample/model/User.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.swagger.sample.model;
1818

19-
import io.swagger.oas.annotations.media.Schema;
19+
import io.swagger.v3.oas.annotations.media.Schema;
2020

2121
import javax.xml.bind.annotation.*;
2222

java/java-dropwizard/src/main/java/io/swagger/sample/resource/PetResource.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package io.swagger.sample.resource;
1818

19-
import io.swagger.oas.annotations.Operation;
20-
import io.swagger.oas.annotations.Parameter;
21-
import io.swagger.oas.annotations.media.Content;
22-
import io.swagger.oas.annotations.media.Schema;
23-
import io.swagger.oas.annotations.responses.ApiResponse;
19+
import io.swagger.v3.oas.annotations.Operation;
20+
import io.swagger.v3.oas.annotations.Parameter;
21+
import io.swagger.v3.oas.annotations.media.Content;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
2424
import io.swagger.sample.data.PetData;
2525
import io.swagger.sample.model.Pet;
2626

java/java-jersey2/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22
<parent>
3-
<groupId>io.swagger</groupId>
3+
<groupId>io.swagger.samples.v3</groupId>
44
<artifactId>swagger-samples-project</artifactId>
55
<version>2.0.0</version>
66
<relativePath>../..</relativePath>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
9-
<groupId>io.swagger</groupId>
9+
<groupId>io.swagger.samples.v3</groupId>
1010
<artifactId>swagger-jersey2-sample-app</artifactId>
1111
<packaging>war</packaging>
1212
<name>swagger-jersey2-jaxrs-app</name>
@@ -134,7 +134,7 @@
134134
</build>
135135
<dependencies>
136136
<dependency>
137-
<groupId>io.swagger</groupId>
137+
<groupId>io.swagger.core.v3</groupId>
138138
<artifactId>swagger-jaxrs2</artifactId>
139139
<scope>compile</scope>
140140
<version>${swagger-version}</version>

java/java-jersey2/src/main/java/io/swagger/sample/Bootstrap.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package io.swagger.sample;
22

3-
import io.swagger.jaxrs2.integration.JaxrsOpenApiContextBuilder;
4-
import io.swagger.oas.integration.SwaggerConfiguration;
5-
import io.swagger.oas.integration.OpenApiConfigurationException;
6-
import io.swagger.oas.models.OpenAPI;
7-
import io.swagger.oas.models.info.Contact;
8-
import io.swagger.oas.models.info.Info;
9-
import io.swagger.oas.models.info.License;
3+
import io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContextBuilder;
4+
import io.swagger.v3.oas.integration.SwaggerConfiguration;
5+
import io.swagger.v3.oas.integration.OpenApiConfigurationException;
6+
import io.swagger.v3.oas.models.OpenAPI;
7+
import io.swagger.v3.oas.models.info.Contact;
8+
import io.swagger.v3.oas.models.info.Info;
9+
import io.swagger.v3.oas.models.info.License;
1010

1111
import javax.servlet.ServletConfig;
1212
import javax.servlet.ServletException;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.swagger.sample;
2+
3+
import org.glassfish.jersey.server.ResourceConfig;
4+
5+
import javax.ws.rs.ApplicationPath;
6+
import javax.ws.rs.core.Application;
7+
8+
@ApplicationPath("/test")
9+
public class MyApplication extends ResourceConfig {
10+
11+
public MyApplication() {
12+
super();
13+
}
14+
}

java/java-jersey2/src/main/java/io/swagger/sample/model/AuthenticationInfo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.swagger.sample.model;
22

3-
import io.swagger.oas.annotations.media.Schema;
3+
import io.swagger.v3.oas.annotations.media.Schema;
44

55
import javax.ws.rs.HeaderParam;
66

java/java-jersey2/src/main/java/io/swagger/sample/model/Order.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.swagger.sample.model;
1818

19-
import io.swagger.oas.annotations.media.Schema;
19+
import io.swagger.v3.oas.annotations.media.Schema;
2020

2121
import javax.xml.bind.annotation.XmlElement;
2222
import javax.xml.bind.annotation.XmlRootElement;

java/java-jersey2/src/main/java/io/swagger/sample/model/Pet.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.swagger.sample.model;
1818

19-
import io.swagger.oas.annotations.media.Schema;
19+
import io.swagger.v3.oas.annotations.media.Schema;
2020

2121
import javax.xml.bind.annotation.XmlElement;
2222
import javax.xml.bind.annotation.XmlElementWrapper;
@@ -33,6 +33,17 @@ public class Pet {
3333
private List<Tag> tags = new ArrayList<Tag>();
3434
private String status;
3535

36+
@Schema(required = true, example = "[2, 3]")
37+
private int[] lorem;
38+
39+
public int[] getLorem() {
40+
return lorem;
41+
}
42+
43+
public void setLorem(int[] lorem) {
44+
this.lorem = lorem;
45+
}
46+
3647
@XmlElement(name = "id")
3748
public long getId() {
3849
return id;

java/java-jersey2/src/main/java/io/swagger/sample/model/User.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.swagger.sample.model;
1818

19-
import io.swagger.oas.annotations.media.Schema;
19+
import io.swagger.v3.oas.annotations.media.Schema;
2020

2121
import javax.xml.bind.annotation.XmlElement;
2222
import javax.xml.bind.annotation.XmlRootElement;

java/java-jersey2/src/main/java/io/swagger/sample/resource/Metadata.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package io.swagger.sample.resource;
22

33

4-
import io.swagger.oas.annotations.OpenAPIDefinition;
5-
import io.swagger.oas.annotations.info.Info;
4+
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
5+
import io.swagger.v3.oas.annotations.info.Info;
66

77
@OpenAPIDefinition(info = @Info(title = "My API", version = "1.2.3", description = "A sample API"))
88
public class Metadata {

java/java-jersey2/src/main/java/io/swagger/sample/resource/PetResource.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package io.swagger.sample.resource;
1818

19-
import io.swagger.oas.annotations.Operation;
20-
import io.swagger.oas.annotations.Parameter;
21-
import io.swagger.oas.annotations.media.Content;
22-
import io.swagger.oas.annotations.media.Schema;
23-
import io.swagger.oas.annotations.responses.ApiResponse;
19+
import io.swagger.v3.oas.annotations.Operation;
20+
import io.swagger.v3.oas.annotations.Parameter;
21+
import io.swagger.v3.oas.annotations.media.Content;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
2424
import io.swagger.sample.data.PetData;
2525
import io.swagger.sample.model.Pet;
2626

java/java-jersey2/src/main/java/io/swagger/sample/resource/PetStoreResource.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package io.swagger.sample.resource;
1818

19-
import io.swagger.oas.annotations.Operation;
20-
import io.swagger.oas.annotations.Parameter;
21-
import io.swagger.oas.annotations.media.Content;
22-
import io.swagger.oas.annotations.media.Schema;
23-
import io.swagger.oas.annotations.responses.ApiResponse;
19+
import io.swagger.v3.oas.annotations.Operation;
20+
import io.swagger.v3.oas.annotations.Parameter;
21+
import io.swagger.v3.oas.annotations.media.Content;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
2424
import io.swagger.sample.data.StoreData;
2525
import io.swagger.sample.model.AuthenticationInfo;
2626
import io.swagger.sample.model.Order;

java/java-jersey2/src/main/java/io/swagger/sample/resource/UserResource.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package io.swagger.sample.resource;
1818

19-
import io.swagger.oas.annotations.Operation;
20-
import io.swagger.oas.annotations.Parameter;
21-
import io.swagger.oas.annotations.media.Content;
22-
import io.swagger.oas.annotations.media.Schema;
23-
import io.swagger.oas.annotations.responses.ApiResponse;
19+
import io.swagger.v3.oas.annotations.Operation;
20+
import io.swagger.v3.oas.annotations.Parameter;
21+
import io.swagger.v3.oas.annotations.media.Content;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
2424
import io.swagger.sample.data.UserData;
2525
import io.swagger.sample.exception.ApiException;
2626
import io.swagger.sample.model.User;

java/java-jersey2/src/main/java/io/swagger/sample/util/ApiAuthorizationFilterImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package io.swagger.sample.util;
1818

19-
import io.swagger.core.filter.AbstractSpecFilter;
20-
import io.swagger.model.ApiDescription;
21-
import io.swagger.oas.models.Operation;
19+
import io.swagger.v3.core.filter.AbstractSpecFilter;
20+
import io.swagger.v3.core.model.ApiDescription;
21+
import io.swagger.v3.oas.models.Operation;
2222
import org.slf4j.Logger;
2323
import org.slf4j.LoggerFactory;
2424

java/java-jersey2/src/main/java/io/swagger/sample/util/JsonProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.swagger.sample.util;
22

33
import com.fasterxml.jackson.databind.ObjectMapper;
4-
import io.swagger.util.Json;
4+
import io.swagger.v3.core.util.Json;
55

66
import javax.ws.rs.ext.ContextResolver;
77
import javax.ws.rs.ext.Provider;

java/java-jersey2/src/main/webapp/WEB-INF/web.xml

+10-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
</init-param>
1313
<init-param>
1414
<param-name>jersey.config.server.provider.packages</param-name>
15-
<!-- adding 'io.swagger.jaxrs2.integration.resources' is sufficent on it own to register the following paths:
15+
<!-- adding 'io.swagger.v3.jaxrs2.integration.resources' is sufficent on it own to register the following paths:
1616
/openapi.json : OpenApi spec in json
1717
/openapi.yaml : OpenApi spec in yaml
1818
/openapi (Accept: : "application/json" : OpenApi spec in json
1919
/openapi (Accept: : "application/yaml" : OpenApi spec in yaml
2020
-->
2121
<param-value>
22-
com.fasterxml.jackson.jaxrs.json,io.swagger.jaxrs2.integration.resources,io.swagger.sample.resource
22+
com.fasterxml.jackson.jaxrs.json,io.swagger.v3.jaxrs2.integration.resources,io.swagger.sample.resource
2323
</param-value>
2424

2525
<!--
@@ -28,12 +28,18 @@
2828
</param-value>
2929
-->
3030
</init-param>
31+
<!--
32+
<init-param>
33+
<param-name>javax.ws.rs.Application</param-name>
34+
<param-value>io.swagger.sample.MyApplication</param-value>
35+
</init-param>
36+
-->
3137
<!-- alternatively specify resources classes
3238
<init-param>
3339
<param-name>jersey.config.server.provider.classnames</param-name>
3440
3541
<param-value>
36-
io.swagger.jaxrs2.integration.resources.OpenApiResource,
42+
io.swagger.v3.jaxrs2.integration.resources.OpenApiResource,
3743
io.swagger.sample.resource.PetResource,
3844
io.swagger.sample.resource.UserResource
3945
</param-value>
@@ -64,7 +70,7 @@
6470
<servlet>
6571
<!-- use OpenApi servlet to serve spec -->
6672
<servlet-name>OpenApi</servlet-name>
67-
<servlet-class>io.swagger.jaxrs2.integration.OpenApiServlet</servlet-class>
73+
<servlet-class>io.swagger.v3.jaxrs2.integration.OpenApiServlet</servlet-class>
6874

6975
<!-- alternatively specify resource package
7076
<init-param>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<version>5</version>
66
</parent>
77
<modelVersion>4.0.0</modelVersion>
8-
<groupId>io.swagger</groupId>
8+
<groupId>io.swagger.samples.v3</groupId>
99
<artifactId>swagger-samples-project</artifactId>
1010
<packaging>pom</packaging>
1111
<name>swagger-samples</name>

0 commit comments

Comments
 (0)