docusaurus-plugin-openapi-docs 2.0.0-beta.1 → 2.0.0-beta.2

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 CHANGED
@@ -133,13 +133,13 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
133
133
 
134
134
  `sidebarOptions` can be configured with the following options:
135
135
 
136
- | Name | Type | Default | Description |
137
- | -------------------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
138
- | `groupPathsBy` | `string` | `null` | Organize and group sidebar slice by specified option. Note: Currently, `groupPathsBy` only contains support for grouping by `tag`. |
139
- | `categoryLinkSource` | `string` | `null` | Defines what source to use for rendering category link pages when grouping paths by tag. <br/><br/>The supported options are as follows: <br/><br/> `tag`: Sets the category link config type to `generated-index` and uses the tag description as the link config description. <br/><br/>`info`: Sets the category link config type to `doc` and renders the `info` section as the category link (recommended only for multi/micro-spec scenarios). <br/><br/>`none`: Does not create pages for categories, only groups that can be expanded/collapsed. |
140
- | `sidebarCollapsible` | `boolean` | `true` | Whether sidebar categories are collapsible by default. |
141
- | `sidebarCollapsed` | `boolean` | `true` | Whether sidebar categories are collapsed by default. |
142
- | `customProps` | `object` | `null` | Additional props for customizing a sidebar item. |
136
+ | Name | Type | Default | Description |
137
+ | -------------------- | --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
138
+ | `groupPathsBy` | `string` | `null` | Organize and group sidebar slice by specified option. Note: Currently, `groupPathsBy` only contains support for grouping by `tag`. |
139
+ | `categoryLinkSource` | `string` | `null` | Defines what source to use for rendering category pages when grouping paths by tag. By default, pages are not created for categories, only groups that can be expanded/collapsed. <br/><br/>The supported options are as follows: <br/><br/> `auto`: Sets the category link config type to `generated-index`, building an index page with links to each page in the group.<br/><br/> `tag`: Sets the category link config type to `generated-index` and uses the tag description at the top of the page. <br/><br/>`info`: Sets the category link config type to `doc` and renders the `info` section as the category link (recommended only for multi/micro-spec scenarios). |
140
+ | `sidebarCollapsible` | `boolean` | `true` | Whether sidebar categories are collapsible by default. |
141
+ | `sidebarCollapsed` | `boolean` | `true` | Whether sidebar categories are collapsed by default. |
142
+ | `customProps` | `object` | `null` | Additional props for customizing a sidebar item. |
143
143
 
144
144
  > You may optionally configure a `sidebarOptions`. In doing so, an individual `sidebar.js` slice with the configured options will be generated within the respective `outputDir`.
145
145
 
@@ -30,7 +30,7 @@ function mergeAllOf(allOf) {
30
30
  return true;
31
31
  },
32
32
  },
33
- ignoreAdditionalProperties: false,
33
+ ignoreAdditionalProperties: true,
34
34
  });
35
35
  const required = allOf.reduce((acc, cur) => {
36
36
  if (Array.isArray(cur.required)) {
package/lib/options.js CHANGED
@@ -10,8 +10,7 @@ exports.OptionsSchema = void 0;
10
10
  const utils_validation_1 = require("@docusaurus/utils-validation");
11
11
  const sidebarOptions = utils_validation_1.Joi.object({
12
12
  groupPathsBy: utils_validation_1.Joi.string().valid("tag"),
13
- // TODO: Remove "none" in 2.0, make it the default if not specified
14
- categoryLinkSource: utils_validation_1.Joi.string().valid("tag", "info", "none"),
13
+ categoryLinkSource: utils_validation_1.Joi.string().valid("tag", "info", "auto"),
15
14
  customProps: utils_validation_1.Joi.object(),
16
15
  sidebarCollapsible: utils_validation_1.Joi.boolean(),
17
16
  sidebarCollapsed: utils_validation_1.Joi.boolean(),
@@ -90,6 +90,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
90
90
  };
91
91
  });
92
92
  // TODO: perhaps move this into a getLinkConfig() function
93
+ // Default to no link config (spindowns only)
93
94
  let linkConfig = undefined;
94
95
  if (taggedInfoObject !== undefined && categoryLinkSource === "info") {
95
96
  linkConfig = {
@@ -107,8 +108,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
107
108
  id: basePath === "" || undefined ? `${tagId}` : `${basePath}/${tagId}`,
108
109
  };
109
110
  }
110
- // Default behavior
111
- if (categoryLinkSource === undefined) {
111
+ if (categoryLinkSource === "auto") {
112
112
  linkConfig = {
113
113
  type: "generated-index",
114
114
  title: tag,
package/lib/types.d.ts CHANGED
@@ -25,7 +25,7 @@ export interface APIOptions {
25
25
  }
26
26
  export interface SidebarOptions {
27
27
  groupPathsBy?: string;
28
- categoryLinkSource?: string;
28
+ categoryLinkSource?: "info" | "tag" | "auto";
29
29
  customProps?: {
30
30
  [key: string]: unknown;
31
31
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-openapi-docs",
3
3
  "description": "OpenAPI plugin for Docusaurus.",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0-beta.2",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -68,5 +68,5 @@
68
68
  "engines": {
69
69
  "node": ">=14"
70
70
  },
71
- "gitHead": "adcd05075257f6d00321dc289445d0306306b7ee"
71
+ "gitHead": "ba8fd77e6b9e90e0bca5e169fbc1c71ac50f44e0"
72
72
  }
@@ -34,7 +34,7 @@ export function mergeAllOf(allOf: SchemaObject[]) {
34
34
  return true;
35
35
  },
36
36
  },
37
- ignoreAdditionalProperties: false,
37
+ ignoreAdditionalProperties: true,
38
38
  });
39
39
 
40
40
  const required = allOf.reduce((acc, cur) => {
package/src/options.ts CHANGED
@@ -9,8 +9,7 @@ import { Joi } from "@docusaurus/utils-validation";
9
9
 
10
10
  const sidebarOptions = Joi.object({
11
11
  groupPathsBy: Joi.string().valid("tag"),
12
- // TODO: Remove "none" in 2.0, make it the default if not specified
13
- categoryLinkSource: Joi.string().valid("tag", "info", "none"),
12
+ categoryLinkSource: Joi.string().valid("tag", "info", "auto"),
14
13
  customProps: Joi.object(),
15
14
  sidebarCollapsible: Joi.boolean(),
16
15
  sidebarCollapsed: Joi.boolean(),
@@ -130,6 +130,7 @@ function groupByTags(
130
130
  );
131
131
 
132
132
  // TODO: perhaps move this into a getLinkConfig() function
133
+ // Default to no link config (spindowns only)
133
134
  let linkConfig = undefined;
134
135
  if (taggedInfoObject !== undefined && categoryLinkSource === "info") {
135
136
  linkConfig = {
@@ -151,8 +152,7 @@ function groupByTags(
151
152
  } as SidebarItemCategoryLinkConfig;
152
153
  }
153
154
 
154
- // Default behavior
155
- if (categoryLinkSource === undefined) {
155
+ if (categoryLinkSource === "auto") {
156
156
  linkConfig = {
157
157
  type: "generated-index" as "generated-index",
158
158
  title: tag,
package/src/types.ts CHANGED
@@ -46,7 +46,7 @@ export interface APIOptions {
46
46
 
47
47
  export interface SidebarOptions {
48
48
  groupPathsBy?: string;
49
- categoryLinkSource?: string;
49
+ categoryLinkSource?: "info" | "tag" | "auto";
50
50
  customProps?: { [key: string]: unknown };
51
51
  sidebarCollapsible?: boolean;
52
52
  sidebarCollapsed?: boolean;