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

Commit e1b7f34

Browse files
committed
added metadata class for info
1 parent 9ed0da9 commit e1b7f34

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io.swagger.jaxrs2.Reader;
44
import io.swagger.oas.models.OpenAPI;
5+
import io.swagger.sample.resource.Metadata;
56
import io.swagger.sample.resource.PetResource;
67
import io.swagger.sample.resource.UserResource;
78

@@ -16,12 +17,11 @@ public void init(ServletConfig config) throws ServletException {
1617

1718
Reader reader = new Reader(oas, null);
1819

19-
oas = reader.read(UserResource.class);
20-
oas = reader.read(PetResource.class);
21-
config.getServletContext().setAttribute("oas", oas);
22-
23-
20+
reader.read(Metadata.class);
21+
reader.read(UserResource.class);
22+
reader.read(PetResource.class);
2423

24+
config.getServletContext().setAttribute("oas", reader.getOpenAPI());
2525

2626
/*
2727
Info info = new Info()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package io.swagger.sample.resource;
2+
3+
4+
import io.swagger.oas.annotations.info.Info;
5+
6+
@Info(title = "My API", version = "1.2.3", description = "A sample API")
7+
public class Metadata {
8+
}

0 commit comments

Comments
 (0)