directus-extension-api-docs 1.2.11 → 1.3.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.
- package/README.md +12 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,13 +22,20 @@ Ref: https://github.com/directus/directus
|
|
|
22
22
|
|
|
23
23
|
For include you custom endpoints.
|
|
24
24
|
|
|
25
|
-
Create a `oasconfig.
|
|
25
|
+
Create a `oasconfig.js` file under `/extensions/endpoints` folder.
|
|
26
|
+
|
|
27
|
+
Options:
|
|
28
|
+
|
|
29
|
+
- `docsPath` path where the interface will be
|
|
30
|
+
- `tags` openapi custom tags
|
|
31
|
+
- `paths` openapi custom paths
|
|
32
|
+
- `components` openapi custom components (you can ref to directus standard components declaring them empty)
|
|
26
33
|
|
|
27
34
|
Example below:
|
|
28
35
|
|
|
29
36
|
```
|
|
30
37
|
module.exports = {
|
|
31
|
-
docsPath: 'api-docs',
|
|
38
|
+
docsPath: 'api-docs', // optional default 'api-docs'
|
|
32
39
|
tags: [
|
|
33
40
|
{
|
|
34
41
|
name: 'MyCustomTag',
|
|
@@ -84,6 +91,7 @@ module.exports = {
|
|
|
84
91
|
},
|
|
85
92
|
},
|
|
86
93
|
},
|
|
94
|
+
components: {},
|
|
87
95
|
};
|
|
88
96
|
```
|
|
89
97
|
|
|
@@ -92,7 +100,8 @@ module.exports = {
|
|
|
92
100
|
You can enable a request validations middleware based on your custom definitions.
|
|
93
101
|
|
|
94
102
|
Call `validate` function inside your custom endpoint registration.
|
|
95
|
-
|
|
103
|
+
|
|
104
|
+
Pass your `router`, `services`, `schema` and (_optional_) a list of endpoints you want to validate.
|
|
96
105
|
|
|
97
106
|
Example below:
|
|
98
107
|
|