@ahmttyydn/java-integration 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +762 -0
  2. package/README.md +37 -0
  3. package/package.json +46 -0
  4. package/pom.xml +242 -0
  5. package/scalar-core/pom.xml +92 -0
  6. package/scalar-core/src/main/java/com/scalar/maven/core/ScalarConstants.java +26 -0
  7. package/scalar-core/src/main/java/com/scalar/maven/core/ScalarHtmlRenderer.java +135 -0
  8. package/scalar-core/src/main/java/com/scalar/maven/core/ScalarProperties.java +596 -0
  9. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/ScalarAuthenticationOptions.java +235 -0
  10. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/AuthorizationCodeFlow.java +160 -0
  11. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/ClientCredentialsFlow.java +88 -0
  12. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/ImplicitFlow.java +64 -0
  13. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/OAuthFlow.java +185 -0
  14. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/PasswordFlow.java +134 -0
  15. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/ScalarFlows.java +113 -0
  16. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarApiKeySecurityScheme.java +77 -0
  17. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarHttpSecurityScheme.java +115 -0
  18. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarOAuth2SecurityScheme.java +75 -0
  19. package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarSecurityScheme.java +45 -0
  20. package/scalar-core/src/main/java/com/scalar/maven/core/config/DefaultHttpClient.java +77 -0
  21. package/scalar-core/src/main/java/com/scalar/maven/core/config/ScalarAgentOptions.java +68 -0
  22. package/scalar-core/src/main/java/com/scalar/maven/core/config/ScalarServer.java +197 -0
  23. package/scalar-core/src/main/java/com/scalar/maven/core/config/ScalarSource.java +151 -0
  24. package/scalar-core/src/main/java/com/scalar/maven/core/enums/CredentialsLocation.java +52 -0
  25. package/scalar-core/src/main/java/com/scalar/maven/core/enums/DeveloperToolsVisibility.java +58 -0
  26. package/scalar-core/src/main/java/com/scalar/maven/core/enums/DocumentDownloadType.java +67 -0
  27. package/scalar-core/src/main/java/com/scalar/maven/core/enums/OperationSorter.java +52 -0
  28. package/scalar-core/src/main/java/com/scalar/maven/core/enums/OperationTitleSource.java +52 -0
  29. package/scalar-core/src/main/java/com/scalar/maven/core/enums/Pkce.java +57 -0
  30. package/scalar-core/src/main/java/com/scalar/maven/core/enums/PropertyOrder.java +53 -0
  31. package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarClient.java +208 -0
  32. package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarLayout.java +52 -0
  33. package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarTarget.java +158 -0
  34. package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarTheme.java +102 -0
  35. package/scalar-core/src/main/java/com/scalar/maven/core/enums/TagSorter.java +47 -0
  36. package/scalar-core/src/main/java/com/scalar/maven/core/enums/ThemeMode.java +52 -0
  37. package/scalar-core/src/main/java/com/scalar/maven/core/internal/ScalarConfiguration.java +425 -0
  38. package/scalar-core/src/main/java/com/scalar/maven/core/internal/ScalarConfigurationMapper.java +69 -0
  39. package/scalar-core/src/main/resources/META-INF/resources/webjars/scalar/index.html +22 -0
  40. package/scalar-core/src/test/java/com/scalar/maven/core/ScalarConfigurationTest.java +144 -0
  41. package/scalar-core/src/test/java/com/scalar/maven/core/ScalarHtmlRendererTest.java +104 -0
  42. package/scalar-core/src/test/java/com/scalar/maven/core/ScalarPropertiesTest.java +525 -0
  43. package/scalar-core/src/test/java/com/scalar/maven/core/config/DefaultHttpClientTest.java +61 -0
  44. package/scalar-core/src/test/java/com/scalar/maven/core/config/ScalarAgentOptionsTest.java +80 -0
  45. package/scalar-core/src/test/java/com/scalar/maven/core/config/ScalarServerTest.java +118 -0
  46. package/scalar-core/src/test/java/com/scalar/maven/core/config/ScalarSourceTest.java +105 -0
  47. package/scalar-playground-webflux/pom.xml +52 -0
  48. package/scalar-playground-webflux/src/main/java/com/scalar/maven/playground/CustomScalarWebFluxController.java +34 -0
  49. package/scalar-playground-webflux/src/main/java/com/scalar/maven/playground/PlaygroundApplication.java +27 -0
  50. package/scalar-playground-webflux/src/main/resources/application.properties +7 -0
  51. package/scalar-playground-webmvc/pom.xml +52 -0
  52. package/scalar-playground-webmvc/src/main/java/com/scalar/maven/playground/CustomScalarWebMvcController.java +34 -0
  53. package/scalar-playground-webmvc/src/main/java/com/scalar/maven/playground/PlaygroundApplication.java +27 -0
  54. package/scalar-playground-webmvc/src/main/resources/application.properties +7 -0
  55. package/scalar-webflux/pom.xml +110 -0
  56. package/scalar-webflux/src/main/java/com/scalar/maven/webflux/ScalarWebFluxActuatorEndpoint.java +103 -0
  57. package/scalar-webflux/src/main/java/com/scalar/maven/webflux/ScalarWebFluxAutoConfiguration.java +63 -0
  58. package/scalar-webflux/src/main/java/com/scalar/maven/webflux/ScalarWebFluxController.java +109 -0
  59. package/scalar-webflux/src/main/java/com/scalar/maven/webflux/SpringBootScalarProperties.java +43 -0
  60. package/scalar-webflux/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +2 -0
  61. package/scalar-webflux/src/test/java/com/scalar/maven/webflux/ScalarWebFluxActuatorEndpointTest.java +136 -0
  62. package/scalar-webflux/src/test/java/com/scalar/maven/webflux/ScalarWebFluxControllerTest.java +162 -0
  63. package/scalar-webmvc/pom.xml +103 -0
  64. package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/ScalarWebMvcActuatorEndpoint.java +97 -0
  65. package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/ScalarWebMvcAutoConfiguration.java +63 -0
  66. package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/ScalarWebMvcController.java +103 -0
  67. package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/SpringBootScalarProperties.java +43 -0
  68. package/scalar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +2 -0
  69. package/scalar-webmvc/src/test/java/com/scalar/maven/webmvc/ScalarWebMvcActuatorEndpointTest.java +128 -0
  70. package/scalar-webmvc/src/test/java/com/scalar/maven/webmvc/ScalarWebMvcControllerTest.java +154 -0
@@ -0,0 +1,102 @@
1
+ package com.scalar.maven.core.enums;
2
+
3
+ import com.fasterxml.jackson.annotation.JsonCreator;
4
+ import com.fasterxml.jackson.annotation.JsonValue;
5
+
6
+ /**
7
+ * Represents the different themes available in Scalar.
8
+ */
9
+ public enum ScalarTheme {
10
+ /**
11
+ * No theme applied.
12
+ */
13
+ NONE("none"),
14
+
15
+ /**
16
+ * Alternate theme.
17
+ */
18
+ ALTERNATE("alternate"),
19
+
20
+ /**
21
+ * Default theme.
22
+ */
23
+ DEFAULT("default"),
24
+
25
+ /**
26
+ * Moon theme.
27
+ */
28
+ MOON("moon"),
29
+
30
+ /**
31
+ * Purple theme.
32
+ */
33
+ PURPLE("purple"),
34
+
35
+ /**
36
+ * Solarized theme.
37
+ */
38
+ SOLARIZED("solarized"),
39
+
40
+ /**
41
+ * Blue Planet theme.
42
+ */
43
+ BLUE_PLANET("bluePlanet"),
44
+
45
+ /**
46
+ * Saturn theme.
47
+ */
48
+ SATURN("saturn"),
49
+
50
+ /**
51
+ * Kepler theme.
52
+ */
53
+ KEPLER("kepler"),
54
+
55
+ /**
56
+ * Mars theme.
57
+ */
58
+ MARS("mars"),
59
+
60
+ /**
61
+ * Deep Space theme.
62
+ */
63
+ DEEP_SPACE("deepSpace"),
64
+
65
+ /**
66
+ * Laserwave theme.
67
+ */
68
+ LASERWAVE("laserwave");
69
+
70
+ private final String value;
71
+
72
+ ScalarTheme(String value) {
73
+ this.value = value;
74
+ }
75
+
76
+ /**
77
+ * Creates a ScalarTheme from a string value.
78
+ *
79
+ * @param value the string value
80
+ * @return the corresponding ScalarTheme
81
+ * @throws IllegalArgumentException if the value is not recognized
82
+ */
83
+ @JsonCreator
84
+ public static ScalarTheme fromValue(String value) {
85
+ for (ScalarTheme theme : values()) {
86
+ if (theme.value.equals(value)) {
87
+ return theme;
88
+ }
89
+ }
90
+ throw new IllegalArgumentException("Unknown theme: " + value);
91
+ }
92
+
93
+ /**
94
+ * Gets the string value for JSON serialization.
95
+ *
96
+ * @return the string value
97
+ */
98
+ @JsonValue
99
+ public String getValue() {
100
+ return value;
101
+ }
102
+ }
@@ -0,0 +1,47 @@
1
+ package com.scalar.maven.core.enums;
2
+
3
+ import com.fasterxml.jackson.annotation.JsonCreator;
4
+ import com.fasterxml.jackson.annotation.JsonValue;
5
+
6
+ /**
7
+ * Represents the sorting method for tags in the Scalar API Reference.
8
+ */
9
+ public enum TagSorter {
10
+ /**
11
+ * Sort tags alphabetically.
12
+ */
13
+ ALPHA("alpha");
14
+
15
+ private final String value;
16
+
17
+ TagSorter(String value) {
18
+ this.value = value;
19
+ }
20
+
21
+ /**
22
+ * Creates a TagSorter from a string value.
23
+ *
24
+ * @param value the string value
25
+ * @return the corresponding TagSorter
26
+ * @throws IllegalArgumentException if the value is not recognized
27
+ */
28
+ @JsonCreator
29
+ public static TagSorter fromValue(String value) {
30
+ for (TagSorter sorter : values()) {
31
+ if (sorter.value.equals(value)) {
32
+ return sorter;
33
+ }
34
+ }
35
+ throw new IllegalArgumentException("Unknown tag sorter: " + value);
36
+ }
37
+
38
+ /**
39
+ * Gets the string value for JSON serialization.
40
+ *
41
+ * @return the string value
42
+ */
43
+ @JsonValue
44
+ public String getValue() {
45
+ return value;
46
+ }
47
+ }
@@ -0,0 +1,52 @@
1
+ package com.scalar.maven.core.enums;
2
+
3
+ import com.fasterxml.jackson.annotation.JsonCreator;
4
+ import com.fasterxml.jackson.annotation.JsonValue;
5
+
6
+ /**
7
+ * Represents the theme mode for the Scalar API Reference.
8
+ */
9
+ public enum ThemeMode {
10
+ /**
11
+ * Light theme mode.
12
+ */
13
+ LIGHT("light"),
14
+
15
+ /**
16
+ * Dark theme mode.
17
+ */
18
+ DARK("dark");
19
+
20
+ private final String value;
21
+
22
+ ThemeMode(String value) {
23
+ this.value = value;
24
+ }
25
+
26
+ /**
27
+ * Creates a ThemeMode from a string value.
28
+ *
29
+ * @param value the string value
30
+ * @return the corresponding ThemeMode
31
+ * @throws IllegalArgumentException if the value is not recognized
32
+ */
33
+ @JsonCreator
34
+ public static ThemeMode fromValue(String value) {
35
+ for (ThemeMode mode : values()) {
36
+ if (mode.value.equals(value)) {
37
+ return mode;
38
+ }
39
+ }
40
+ throw new IllegalArgumentException("Unknown theme mode: " + value);
41
+ }
42
+
43
+ /**
44
+ * Gets the string value for JSON serialization.
45
+ *
46
+ * @return the string value
47
+ */
48
+ @JsonValue
49
+ public String getValue() {
50
+ return value;
51
+ }
52
+ }
@@ -0,0 +1,425 @@
1
+ package com.scalar.maven.core.internal;
2
+
3
+ import com.fasterxml.jackson.annotation.JsonInclude;
4
+ import com.fasterxml.jackson.annotation.JsonProperty;
5
+ import com.scalar.maven.core.authentication.ScalarAuthenticationOptions;
6
+ import com.scalar.maven.core.config.DefaultHttpClient;
7
+ import com.scalar.maven.core.config.ScalarAgentOptions;
8
+ import com.scalar.maven.core.config.ScalarServer;
9
+ import com.scalar.maven.core.config.ScalarSource;
10
+ import com.scalar.maven.core.enums.*;
11
+
12
+ import java.util.List;
13
+ import java.util.Map;
14
+
15
+ /**
16
+ * Internal representation of the configuration for the Scalar API Reference.
17
+ * <p>
18
+ * <strong>Warning:</strong> This class is internal API and should not be used
19
+ * directly.
20
+ * It may change without notice in future versions. Use
21
+ * {@link com.scalar.maven.core.ScalarProperties} instead.
22
+ * </p>
23
+ * Based on <a href=
24
+ * "https://github.com/scalar/scalar/blob/main/documentation/configuration.md">Configuration</a>.
25
+ */
26
+ @JsonInclude(JsonInclude.Include.NON_NULL)
27
+ public class ScalarConfiguration {
28
+
29
+ @JsonProperty("url")
30
+ private String url;
31
+
32
+ @JsonProperty("proxyUrl")
33
+ private String proxyUrl;
34
+
35
+ @JsonProperty("showSidebar")
36
+ private Boolean showSidebar;
37
+
38
+ @JsonProperty("operationTitleSource")
39
+ private OperationTitleSource operationTitleSource;
40
+
41
+ @JsonProperty("hideModels")
42
+ private Boolean hideModels;
43
+
44
+ @JsonProperty("hideTestRequestButton")
45
+ private Boolean hideTestRequestButton;
46
+
47
+ @JsonProperty("darkMode")
48
+ private Boolean darkMode;
49
+
50
+ @JsonProperty("forceDarkModeState")
51
+ private ThemeMode forceDarkModeState;
52
+
53
+ @JsonProperty("hideDarkModeToggle")
54
+ private Boolean hideDarkModeToggle;
55
+
56
+ @JsonProperty("customCss")
57
+ private String customCss;
58
+
59
+ @JsonProperty("searchHotKey")
60
+ private String searchHotKey;
61
+
62
+ @JsonProperty("servers")
63
+ private List<ScalarServer> servers;
64
+
65
+ @JsonProperty("metaData")
66
+ private Map<String, String> metaData;
67
+
68
+ @JsonProperty("defaultHttpClient")
69
+ private DefaultHttpClient defaultHttpClient;
70
+
71
+ @JsonProperty("authentication")
72
+ private ScalarAuthenticationOptions authentication;
73
+
74
+ @JsonProperty("withDefaultFonts")
75
+ private Boolean withDefaultFonts;
76
+
77
+ @JsonProperty("defaultOpenAllTags")
78
+ private Boolean defaultOpenAllTags;
79
+
80
+ @JsonProperty("expandAllModelSections")
81
+ private Boolean expandAllModelSections;
82
+
83
+ @JsonProperty("expandAllResponses")
84
+ private Boolean expandAllResponses;
85
+
86
+ @JsonProperty("hideSearch")
87
+ private Boolean hideSearch;
88
+
89
+ @JsonProperty("tagsSorter")
90
+ private TagSorter tagSorter;
91
+
92
+ @JsonProperty("operationsSorter")
93
+ private OperationSorter operationsSorter;
94
+
95
+ @JsonProperty("theme")
96
+ private ScalarTheme theme;
97
+
98
+ @JsonProperty("layout")
99
+ private ScalarLayout layout;
100
+
101
+ @JsonProperty("favicon")
102
+ private String favicon;
103
+
104
+ @JsonProperty("hideClientButton")
105
+ private Boolean hideClientButton;
106
+
107
+ @JsonProperty("sources")
108
+ private List<ScalarSource> sources;
109
+
110
+ @JsonProperty("baseServerURL")
111
+ private String baseServerUrl;
112
+
113
+ @JsonProperty("persistAuth")
114
+ private Boolean persistAuth;
115
+
116
+ @JsonProperty("telemetry")
117
+ private Boolean telemetry;
118
+
119
+ @JsonProperty("documentDownloadType")
120
+ private DocumentDownloadType documentDownloadType;
121
+
122
+ @JsonProperty("orderRequiredPropertiesFirst")
123
+ private Boolean orderRequiredPropertiesFirst;
124
+
125
+ @JsonProperty("orderSchemaPropertiesBy")
126
+ private PropertyOrder orderSchemaPropertiesBy;
127
+
128
+ @JsonProperty("showOperationId")
129
+ private Boolean showOperationId;
130
+
131
+ @JsonProperty("showDeveloperTools")
132
+ private DeveloperToolsVisibility showDeveloperTools;
133
+
134
+ @JsonProperty("agent")
135
+ private ScalarAgentOptions agent;
136
+
137
+ // Getters and setters
138
+ public String getUrl() {
139
+ return url;
140
+ }
141
+
142
+ public void setUrl(String url) {
143
+ this.url = url;
144
+ }
145
+
146
+ public String getProxyUrl() {
147
+ return proxyUrl;
148
+ }
149
+
150
+ public void setProxyUrl(String proxyUrl) {
151
+ this.proxyUrl = proxyUrl;
152
+ }
153
+
154
+ public Boolean getShowSidebar() {
155
+ return showSidebar;
156
+ }
157
+
158
+ public void setShowSidebar(Boolean showSidebar) {
159
+ this.showSidebar = showSidebar;
160
+ }
161
+
162
+ public OperationTitleSource getOperationTitleSource() {
163
+ return operationTitleSource;
164
+ }
165
+
166
+ public void setOperationTitleSource(OperationTitleSource operationTitleSource) {
167
+ this.operationTitleSource = operationTitleSource;
168
+ }
169
+
170
+ public Boolean getHideModels() {
171
+ return hideModels;
172
+ }
173
+
174
+ public void setHideModels(Boolean hideModels) {
175
+ this.hideModels = hideModels;
176
+ }
177
+
178
+ public Boolean getHideTestRequestButton() {
179
+ return hideTestRequestButton;
180
+ }
181
+
182
+ public void setHideTestRequestButton(Boolean hideTestRequestButton) {
183
+ this.hideTestRequestButton = hideTestRequestButton;
184
+ }
185
+
186
+ public Boolean getDarkMode() {
187
+ return darkMode;
188
+ }
189
+
190
+ public void setDarkMode(Boolean darkMode) {
191
+ this.darkMode = darkMode;
192
+ }
193
+
194
+ public ThemeMode getForceDarkModeState() {
195
+ return forceDarkModeState;
196
+ }
197
+
198
+ public void setForceDarkModeState(ThemeMode forceDarkModeState) {
199
+ this.forceDarkModeState = forceDarkModeState;
200
+ }
201
+
202
+ public Boolean getHideDarkModeToggle() {
203
+ return hideDarkModeToggle;
204
+ }
205
+
206
+ public void setHideDarkModeToggle(Boolean hideDarkModeToggle) {
207
+ this.hideDarkModeToggle = hideDarkModeToggle;
208
+ }
209
+
210
+ public String getCustomCss() {
211
+ return customCss;
212
+ }
213
+
214
+ public void setCustomCss(String customCss) {
215
+ this.customCss = customCss;
216
+ }
217
+
218
+ public String getSearchHotKey() {
219
+ return searchHotKey;
220
+ }
221
+
222
+ public void setSearchHotKey(String searchHotKey) {
223
+ this.searchHotKey = searchHotKey;
224
+ }
225
+
226
+ public List<ScalarServer> getServers() {
227
+ return servers;
228
+ }
229
+
230
+ public void setServers(List<ScalarServer> servers) {
231
+ this.servers = servers;
232
+ }
233
+
234
+ public Map<String, String> getMetaData() {
235
+ return metaData;
236
+ }
237
+
238
+ public void setMetaData(Map<String, String> metaData) {
239
+ this.metaData = metaData;
240
+ }
241
+
242
+ public DefaultHttpClient getDefaultHttpClient() {
243
+ return defaultHttpClient;
244
+ }
245
+
246
+ public void setDefaultHttpClient(DefaultHttpClient defaultHttpClient) {
247
+ this.defaultHttpClient = defaultHttpClient;
248
+ }
249
+
250
+ public ScalarAuthenticationOptions getAuthentication() {
251
+ return authentication;
252
+ }
253
+
254
+ public void setAuthentication(ScalarAuthenticationOptions authentication) {
255
+ this.authentication = authentication;
256
+ }
257
+
258
+ public Boolean getWithDefaultFonts() {
259
+ return withDefaultFonts;
260
+ }
261
+
262
+ public void setWithDefaultFonts(Boolean withDefaultFonts) {
263
+ this.withDefaultFonts = withDefaultFonts;
264
+ }
265
+
266
+ public Boolean getDefaultOpenAllTags() {
267
+ return defaultOpenAllTags;
268
+ }
269
+
270
+ public void setDefaultOpenAllTags(Boolean defaultOpenAllTags) {
271
+ this.defaultOpenAllTags = defaultOpenAllTags;
272
+ }
273
+
274
+ public Boolean getExpandAllModelSections() {
275
+ return expandAllModelSections;
276
+ }
277
+
278
+ public void setExpandAllModelSections(Boolean expandAllModelSections) {
279
+ this.expandAllModelSections = expandAllModelSections;
280
+ }
281
+
282
+ public Boolean getExpandAllResponses() {
283
+ return expandAllResponses;
284
+ }
285
+
286
+ public void setExpandAllResponses(Boolean expandAllResponses) {
287
+ this.expandAllResponses = expandAllResponses;
288
+ }
289
+
290
+ public Boolean getHideSearch() {
291
+ return hideSearch;
292
+ }
293
+
294
+ public void setHideSearch(Boolean hideSearch) {
295
+ this.hideSearch = hideSearch;
296
+ }
297
+
298
+ public TagSorter getTagSorter() {
299
+ return tagSorter;
300
+ }
301
+
302
+ public void setTagSorter(TagSorter tagSorter) {
303
+ this.tagSorter = tagSorter;
304
+ }
305
+
306
+ public OperationSorter getOperationsSorter() {
307
+ return operationsSorter;
308
+ }
309
+
310
+ public void setOperationsSorter(OperationSorter operationsSorter) {
311
+ this.operationsSorter = operationsSorter;
312
+ }
313
+
314
+ public ScalarTheme getTheme() {
315
+ return theme;
316
+ }
317
+
318
+ public void setTheme(ScalarTheme theme) {
319
+ this.theme = theme;
320
+ }
321
+
322
+ public ScalarLayout getLayout() {
323
+ return layout;
324
+ }
325
+
326
+ public void setLayout(ScalarLayout layout) {
327
+ this.layout = layout;
328
+ }
329
+
330
+ public String getFavicon() {
331
+ return favicon;
332
+ }
333
+
334
+ public void setFavicon(String favicon) {
335
+ this.favicon = favicon;
336
+ }
337
+
338
+ public Boolean getHideClientButton() {
339
+ return hideClientButton;
340
+ }
341
+
342
+ public void setHideClientButton(Boolean hideClientButton) {
343
+ this.hideClientButton = hideClientButton;
344
+ }
345
+
346
+ public List<ScalarSource> getSources() {
347
+ return sources;
348
+ }
349
+
350
+ public void setSources(List<ScalarSource> sources) {
351
+ this.sources = sources;
352
+ }
353
+
354
+ public String getBaseServerUrl() {
355
+ return baseServerUrl;
356
+ }
357
+
358
+ public void setBaseServerUrl(String baseServerUrl) {
359
+ this.baseServerUrl = baseServerUrl;
360
+ }
361
+
362
+ public Boolean getPersistAuth() {
363
+ return persistAuth;
364
+ }
365
+
366
+ public void setPersistAuth(Boolean persistAuth) {
367
+ this.persistAuth = persistAuth;
368
+ }
369
+
370
+ public Boolean getTelemetry() {
371
+ return telemetry;
372
+ }
373
+
374
+ public void setTelemetry(Boolean telemetry) {
375
+ this.telemetry = telemetry;
376
+ }
377
+
378
+ public DocumentDownloadType getDocumentDownloadType() {
379
+ return documentDownloadType;
380
+ }
381
+
382
+ public void setDocumentDownloadType(DocumentDownloadType documentDownloadType) {
383
+ this.documentDownloadType = documentDownloadType;
384
+ }
385
+
386
+ public Boolean getOrderRequiredPropertiesFirst() {
387
+ return orderRequiredPropertiesFirst;
388
+ }
389
+
390
+ public void setOrderRequiredPropertiesFirst(Boolean orderRequiredPropertiesFirst) {
391
+ this.orderRequiredPropertiesFirst = orderRequiredPropertiesFirst;
392
+ }
393
+
394
+ public PropertyOrder getOrderSchemaPropertiesBy() {
395
+ return orderSchemaPropertiesBy;
396
+ }
397
+
398
+ public void setOrderSchemaPropertiesBy(PropertyOrder orderSchemaPropertiesBy) {
399
+ this.orderSchemaPropertiesBy = orderSchemaPropertiesBy;
400
+ }
401
+
402
+ public Boolean getShowOperationId() {
403
+ return showOperationId;
404
+ }
405
+
406
+ public void setShowOperationId(Boolean showOperationId) {
407
+ this.showOperationId = showOperationId;
408
+ }
409
+
410
+ public DeveloperToolsVisibility getShowDeveloperTools() {
411
+ return showDeveloperTools;
412
+ }
413
+
414
+ public void setShowDeveloperTools(DeveloperToolsVisibility showDeveloperTools) {
415
+ this.showDeveloperTools = showDeveloperTools;
416
+ }
417
+
418
+ public ScalarAgentOptions getAgent() {
419
+ return agent;
420
+ }
421
+
422
+ public void setAgent(ScalarAgentOptions agent) {
423
+ this.agent = agent;
424
+ }
425
+ }
@@ -0,0 +1,69 @@
1
+ package com.scalar.maven.core.internal;
2
+
3
+ import com.scalar.maven.core.ScalarProperties;
4
+
5
+ /**
6
+ * Mapper class to convert ScalarProperties to ScalarConfiguration for JSON
7
+ * serialization.
8
+ * <p>
9
+ * <strong>Warning:</strong> This class is internal API and should not be used
10
+ * directly.
11
+ * It may change without notice in future versions.
12
+ * </p>
13
+ */
14
+ public class ScalarConfigurationMapper {
15
+
16
+ private ScalarConfigurationMapper() {
17
+ }
18
+
19
+
20
+ /**
21
+ * Maps ScalarProperties to ScalarConfiguration.
22
+ *
23
+ * @param properties the ScalarProperties to map
24
+ * @return the mapped ScalarConfiguration
25
+ */
26
+ public static ScalarConfiguration map(ScalarProperties properties) {
27
+ ScalarConfiguration config = new ScalarConfiguration();
28
+
29
+ // Basic properties
30
+ config.setUrl(properties.getUrl());
31
+ config.setProxyUrl(properties.getProxyUrl());
32
+ config.setShowSidebar(properties.isShowSidebar());
33
+ config.setHideModels(properties.isHideModels());
34
+ config.setHideTestRequestButton(properties.isHideTestRequestButton());
35
+ config.setDarkMode(properties.isDarkMode());
36
+ config.setHideDarkModeToggle(properties.isHideDarkModeToggle());
37
+ config.setCustomCss(properties.getCustomCss());
38
+ config.setSearchHotKey(properties.getSearchHotKey());
39
+ config.setServers(properties.getServers());
40
+ config.setMetaData(properties.getMetadata());
41
+ config.setDefaultHttpClient(properties.getDefaultHttpClient());
42
+ config.setAuthentication(properties.getAuthentication());
43
+ config.setWithDefaultFonts(properties.isWithDefaultFonts());
44
+ config.setDefaultOpenAllTags(properties.isDefaultOpenAllTags());
45
+ config.setExpandAllModelSections(properties.isExpandAllModelSections());
46
+ config.setExpandAllResponses(properties.isExpandAllResponses());
47
+ config.setHideSearch(properties.isHideSearch());
48
+ config.setFavicon(properties.getFavicon());
49
+ config.setHideClientButton(properties.isHideClientButton());
50
+ config.setSources(properties.getSources());
51
+ config.setBaseServerUrl(properties.getBaseServerUrl());
52
+ config.setPersistAuth(properties.isPersistAuth());
53
+ config.setTelemetry(properties.isTelemetry());
54
+ config.setOrderRequiredPropertiesFirst(properties.isOrderRequiredPropertiesFirst());
55
+ config.setShowOperationId(properties.isShowOperationId());
56
+ config.setTheme(properties.getTheme());
57
+ config.setLayout(properties.getLayout());
58
+ config.setDocumentDownloadType(properties.getDocumentDownloadType());
59
+ config.setOperationTitleSource(properties.getOperationTitleSource());
60
+ config.setTagSorter(properties.getTagSorter());
61
+ config.setOperationsSorter(properties.getOperationSorter());
62
+ config.setForceDarkModeState(properties.getForceThemeMode());
63
+ config.setOrderSchemaPropertiesBy(properties.getSchemaPropertyOrder());
64
+ config.setShowDeveloperTools(properties.getShowDeveloperTools());
65
+ config.setAgent(properties.getAgent());
66
+
67
+ return config;
68
+ }
69
+ }
@@ -0,0 +1,22 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>__PAGE_TITLE__</title>
5
+ <meta charset="utf-8" />
6
+ <meta
7
+ content="width=device-width, initial-scale=1"
8
+ name="viewport" />
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+
14
+ <!-- Load the Script -->
15
+ <script src="__JS_BUNDLE_URL__"></script>
16
+
17
+ <!-- Initialize the Scalar API Reference -->
18
+ <script>
19
+ Scalar.createApiReference('#app', __CONFIGURATION__)
20
+ </script>
21
+ </body>
22
+ </html>