@necessarylion/adonis-autoswagger 0.0.6 → 0.0.8

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.
@@ -74,7 +74,7 @@ class AutoSwagger {
74
74
  return this.uiService.rapidoc(url, style);
75
75
  }
76
76
  scalar(url, proxyUrl = "https://proxy.scalar.com") {
77
- return this.uiService.scalar(url, proxyUrl);
77
+ return this.uiService.scalar(url, proxyUrl, this.options);
78
78
  }
79
79
  stoplight(url, theme = "dark") {
80
80
  return this.uiService.stoplight(url, theme);
package/dist/example.js CHANGED
@@ -125,7 +125,6 @@ class ExampleGenerator {
125
125
  content: {
126
126
  "application/json": {
127
127
  schema: paginated === "true" ? paginatedSchema : normalArraySchema,
128
- example: paginated === "true" ? paginatedEx : [ex],
129
128
  },
130
129
  },
131
130
  };
@@ -139,7 +138,6 @@ class ExampleGenerator {
139
138
  schema: {
140
139
  $ref: "#/components/schemas/" + rawRef,
141
140
  },
142
- example: ex,
143
141
  },
144
142
  },
145
143
  };
package/dist/schema.js CHANGED
@@ -37,7 +37,9 @@ class SchemaService {
37
37
  async getSchemas() {
38
38
  let schemas = {
39
39
  Any: {
40
- description: "Any JSON object not defined as schema",
40
+ type: 'any',
41
+ description: "Any value",
42
+ examples: [true, false, 1, "foo", { foo: "bar" }],
41
43
  },
42
44
  };
43
45
  schemas = {
package/dist/ui.d.ts CHANGED
@@ -20,7 +20,7 @@ export declare class UIService {
20
20
  * @param proxyUrl string
21
21
  * @returns
22
22
  */
23
- scalar(url: string, proxyUrl?: string): string;
23
+ scalar(url: string, proxyUrl: string, options: any): string;
24
24
  /**
25
25
  * Stoplight UI
26
26
  * @param url string
package/dist/ui.js CHANGED
@@ -96,7 +96,7 @@ class UIService {
96
96
  * @param proxyUrl string
97
97
  * @returns
98
98
  */
99
- scalar(url, proxyUrl = "https://proxy.scalar.com") {
99
+ scalar(url, proxyUrl = "https://proxy.scalar.com", options) {
100
100
  return `
101
101
  <!doctype html>
102
102
  <html>
@@ -115,10 +115,13 @@ class UIService {
115
115
  <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
116
116
  <script>
117
117
  Scalar.createApiReference('#app', {
118
- persistAuth: true,
118
+ persistAuth: ${options?.persistAuthorization},
119
119
  url: '${url}',
120
120
  proxyUrl: '${proxyUrl}',
121
- theme: 'kepler',
121
+ expandAllResponses: true,
122
+ authentication: {
123
+ preferredSecurityScheme: '${options?.defaultSecurityScheme}',
124
+ }
122
125
  })
123
126
  </script>
124
127
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@necessarylion/adonis-autoswagger",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Auto-Generate swagger docs for AdonisJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",