directus-extension-api-docs 1.2.11 → 1.3.0

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 (2) hide show
  1. package/README.md +12 -3
  2. 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.json` file under `/extensions/endpoints` folder.
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
- Pass your `router` and a list of endpoints you want to validate.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "directus-extension-api-docs",
3
- "version": "1.2.11",
3
+ "version": "1.3.0",
4
4
  "description": "directus extension for swagger interface and custom endpoints definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",