|
26 | 26 | import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
|
27 | 27 | import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn;
|
28 | 28 | import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType;
|
| 29 | +import org.eclipse.microprofile.openapi.annotations.extensions.Extension; |
29 | 30 | import org.eclipse.microprofile.openapi.annotations.headers.Header;
|
30 | 31 | import org.eclipse.microprofile.openapi.annotations.info.Contact;
|
31 | 32 | import org.eclipse.microprofile.openapi.annotations.info.Info;
|
|
63 | 64 | @OpenAPIDefinition(
|
64 | 65 | tags = {@Tag(name = "user", description = "Operations about user"),
|
65 | 66 | @Tag(name = "create", description = "Operations about create"),
|
66 |
| - @Tag(name = "Bookings", description = "All the bookings methods")}, |
| 67 | + @Tag(name = "Bookings", description = "All the bookings methods", |
| 68 | + extensions = @Extension(name = "x-tag", value = "test-tag"))}, |
67 | 69 | externalDocs = @ExternalDocumentation(description = "instructions for how to deploy this app",
|
68 |
| - url = "https://github.com/microservices-api/oas3-airlines/blob/master/README.md"), |
| 70 | + url = "https://github.com/microservices-api/oas3-airlines/blob/master/README.md", |
| 71 | + extensions = @Extension(name = "x-external-docs", |
| 72 | + value = "test-external-docs")), |
69 | 73 | info = @Info(title = "AirlinesRatingApp API", version = "1.0",
|
70 | 74 | termsOfService = "http://airlinesratingapp.com/terms",
|
71 | 75 | contact = @Contact(name = "AirlinesRatingApp API Support",
|
72 | 76 | url = "http://exampleurl.com/contact",
|
73 |
| - |
| 77 | + |
| 78 | + extensions = @Extension(name = "x-contact", value = "test-contact")), |
74 | 79 | license = @License(name = "Apache 2.0",
|
75 |
| - url = "http://www.apache.org/licenses/LICENSE-2.0.html")), |
| 80 | + url = "http://www.apache.org/licenses/LICENSE-2.0.html", |
| 81 | + extensions = @Extension(name = "x-license", value = "test-license")), |
| 82 | + extensions = {@Extension(name = "x-info-1", value = "test-info-1"), |
| 83 | + @Extension(name = "x-info", value = "test-info") |
| 84 | + }), |
76 | 85 | security = @SecurityRequirement(name = "airlinesRatingApp_auth"),
|
77 | 86 | securitySets = @SecurityRequirementsSet({
|
78 | 87 | @SecurityRequirement(name = "testScheme1"), @SecurityRequirement(name = "testScheme2")
|
|
88 | 97 | @ServerVariable(name = "port", description = "Booking data",
|
89 | 98 | defaultValue = "8443"),
|
90 | 99 | @ServerVariable(name = "user", description = "User data",
|
91 |
| - defaultValue = "user"), |
| 100 | + defaultValue = "user", |
| 101 | + extensions = @Extension(name = "x-server-variable", |
| 102 | + value = "test-server-variable")), |
92 | 103 | @ServerVariable(name = "basePath", defaultValue = "v2")
|
93 |
| - }), |
| 104 | + }, |
| 105 | + extensions = @Extension(name = "x-server", value = "test-server")), |
94 | 106 | @Server(url = "https://test-server.com:80/basePath", description = "The test API server")
|
95 | 107 | },
|
96 | 108 | components = @Components(
|
|
100 | 112 | implementation = Booking.class),
|
101 | 113 | @Schema(name = "Airlines", title = "Airlines",
|
102 | 114 | type = SchemaType.ARRAY,
|
103 |
| - implementation = Airline.class), |
| 115 | + implementation = Airline.class, |
| 116 | + extensions = @Extension(name = "x-schema", |
| 117 | + value = "test-schema")), |
104 | 118 | @Schema(name = "id", type = SchemaType.INTEGER, format = "int32"),
|
105 | 119 | @Schema(name = "AirlinesRef",
|
106 | 120 | ref = "#/components/schemas/Airlines"),
|
107 | 121 | @Schema(name = "User", implementation = User.class, properties = {
|
108 | 122 | @SchemaProperty(name = "phone",
|
109 | 123 | description = "Telephone number to contact the user",
|
110 |
| - example = "123-456-7891") |
| 124 | + example = "123-456-7891", |
| 125 | + extensions = @Extension(name = "x-schema-property", |
| 126 | + value = "test-schema-property")) |
111 | 127 | })},
|
112 | 128 | responses = {
|
113 | 129 | @APIResponse(name = "FoundAirlines", responseCode = "200",
|
|
133 | 149 | examples = {
|
134 | 150 | @ExampleObject(name = "review", summary = "External review example",
|
135 | 151 | description = "This example exemplifies the content on our site.",
|
136 |
| - externalValue = "http://foo.bar/examples/review-example.json"), |
| 152 | + externalValue = "http://foo.bar/examples/review-example.json", |
| 153 | + extensions = @Extension(name = "x-example-object", |
| 154 | + value = "test-example-object")), |
137 | 155 | @ExampleObject(name = "user", summary = "External user example",
|
138 | 156 | externalValue = "http://foo.bar/examples/user-example.json")
|
139 | 157 | },
|
|
147 | 165 | @Header(name = "Max-Rate", description = "Maximum rate",
|
148 | 166 | schema = @Schema(type = SchemaType.INTEGER),
|
149 | 167 | required = true, allowEmptyValue = true,
|
150 |
| - deprecated = true), |
| 168 | + deprecated = true, |
| 169 | + extensions = @Extension(name = "x-header", |
| 170 | + value = "test-header")), |
151 | 171 | @Header(name = "Request-Limit",
|
152 | 172 | description = "The number of allowed requests in the current period",
|
153 | 173 | schema = @Schema(type = SchemaType.INTEGER))
|
|
172 | 192 | responses = {
|
173 | 193 | @APIResponse(ref = "FoundBookings")
|
174 | 194 | }))
|
175 |
| - })) |
| 195 | + }, |
| 196 | + extensions = @Extension(name = "x-components", value = "test-components")), |
| 197 | + extensions = @Extension(name = "x-openapi-definition", value = "test-openapi-definition")) |
176 | 198 | @SecurityScheme(securitySchemeName = "airlinesRatingApp_auth",
|
177 | 199 | description = "authentication needed to access Airlines app",
|
178 | 200 | type = SecuritySchemeType.APIKEY,
|
179 | 201 | apiKeyName = "api_key",
|
180 |
| - in = SecuritySchemeIn.HEADER) |
| 202 | + in = SecuritySchemeIn.HEADER, |
| 203 | + extensions = @Extension(name = "x-security-scheme", value = "test-security-scheme")) |
181 | 204 | @SecurityScheme(securitySchemeName = "testScheme1",
|
182 | 205 | type = SecuritySchemeType.APIKEY,
|
183 | 206 | apiKeyName = "test1",
|
|
0 commit comments