@dv.net/docs-vitepress-openapi 1.0.8 → 1.0.9
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.
- package/LICENSE +21 -0
- package/README.md +6 -0
- package/dist/docs-vitepress-openapi.css +1 -1
- package/dist/docs-vitepress-openapi.node.cjs.js +72 -72
- package/dist/docs-vitepress-openapi.node.es.js +4171 -4162
- package/package.json +25 -18
- package/src/components/Path/OAPath.vue +11 -1
- package/src/components/Playground/OAPlaygroundParameters.vue +1 -1
package/package.json
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dv.net/docs-vitepress-openapi",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"main": "./dist/docs-vitepress-openapi.node.es.js",
|
|
7
|
+
"module": "./dist/docs-vitepress-openapi.node.es.js",
|
|
8
|
+
"types": "./dist/types/src/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/dv-net/dv-docs-vitepress-openapi.git"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"vitepress": "1.6.3",
|
|
25
|
+
"vue": "3.0.0"
|
|
26
|
+
},
|
|
27
|
+
"resolutions": {
|
|
28
|
+
"@typescript-eslint/utils": "8.21.0"
|
|
29
|
+
},
|
|
6
30
|
"exports": {
|
|
7
31
|
".": {
|
|
8
32
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -14,16 +38,6 @@
|
|
|
14
38
|
},
|
|
15
39
|
"./dist/style.css": "./dist/docs-vitepress-openapi.css"
|
|
16
40
|
},
|
|
17
|
-
"main": "./dist/docs-vitepress-openapi.node.es.js",
|
|
18
|
-
"module": "./dist/docs-vitepress-openapi.node.es.js",
|
|
19
|
-
"types": "./dist/types/src/index.d.ts",
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"src"
|
|
23
|
-
],
|
|
24
|
-
"publishConfig": {
|
|
25
|
-
"access": "public"
|
|
26
|
-
},
|
|
27
41
|
"scripts": {
|
|
28
42
|
"build": "vite build",
|
|
29
43
|
"build-watch": "vite build --watch",
|
|
@@ -31,10 +45,6 @@
|
|
|
31
45
|
"lint:fix": "eslint src --fix",
|
|
32
46
|
"typecheck": "vue-tsc --noEmit"
|
|
33
47
|
},
|
|
34
|
-
"peerDependencies": {
|
|
35
|
-
"vitepress": "1.6.3",
|
|
36
|
-
"vue": "3.0.0"
|
|
37
|
-
},
|
|
38
48
|
"dependencies": {
|
|
39
49
|
"@antfu/eslint-config": "4.2.0",
|
|
40
50
|
"@scalar/openapi-types": "0.1.7",
|
|
@@ -73,8 +83,5 @@
|
|
|
73
83
|
"vue-json-pretty": "2.4.0",
|
|
74
84
|
"vue-tsc": "2.2.0",
|
|
75
85
|
"xml-formatter": "3.6.4"
|
|
76
|
-
},
|
|
77
|
-
"resolutions": {
|
|
78
|
-
"@typescript-eslint/utils": "8.21.0"
|
|
79
86
|
}
|
|
80
87
|
}
|
|
@@ -105,6 +105,16 @@ const baseUrl = computed(() => {
|
|
|
105
105
|
|
|
106
106
|
const shouldBuildRequest = computed(() => ['try-it', 'code-samples'].some(slot => operationSlots.value.includes(slot)))
|
|
107
107
|
|
|
108
|
+
function exampleBody() {
|
|
109
|
+
const examples = operationRequestBody?.content?.[bodyRequestContentType.value]?.examples
|
|
110
|
+
if (!examples)
|
|
111
|
+
return undefined
|
|
112
|
+
|
|
113
|
+
const values = Object.values(examples)
|
|
114
|
+
const explicit = values.find(example => example && !example.isAutogenerated)
|
|
115
|
+
return (explicit ?? values[0])?.value
|
|
116
|
+
}
|
|
117
|
+
|
|
108
118
|
const request = ref(
|
|
109
119
|
shouldBuildRequest.value
|
|
110
120
|
? buildRequest({
|
|
@@ -113,7 +123,7 @@ const request = ref(
|
|
|
113
123
|
baseUrl: baseUrl.value,
|
|
114
124
|
parameters: operationParameters ?? [],
|
|
115
125
|
authorizations: securityUi.length ? Object.entries(securityUi)[0]?.schemes : {},
|
|
116
|
-
body: (
|
|
126
|
+
body: exampleBody(),
|
|
117
127
|
variables: {},
|
|
118
128
|
})
|
|
119
129
|
: {},
|
|
@@ -112,7 +112,7 @@ watch([variables, authorizations, body, () => props.baseUrl], () => {
|
|
|
112
112
|
body: body.value,
|
|
113
113
|
parameters: props.parameters,
|
|
114
114
|
}))
|
|
115
|
-
}, { deep: true })
|
|
115
|
+
}, { deep: true, immediate: true })
|
|
116
116
|
|
|
117
117
|
watch(operationData.security.selectedSchemeId, () => {
|
|
118
118
|
setAuthorizations(
|