docusaurus-theme-openapi-docs 4.6.0 → 4.7.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.
Files changed (64) hide show
  1. package/lib/markdown/schema.js +5 -0
  2. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +1 -1
  3. package/lib/theme/ApiExplorer/Body/FormBodyItem/index.d.ts +1 -1
  4. package/lib/theme/ApiExplorer/Body/FormBodyItem/index.js +1 -1
  5. package/lib/theme/ApiExplorer/Body/index.d.ts +1 -1
  6. package/lib/theme/ApiExplorer/Body/index.js +264 -129
  7. package/lib/theme/ApiExplorer/Body/resolveSchemaWithSelections.d.ts +13 -0
  8. package/lib/theme/ApiExplorer/Body/resolveSchemaWithSelections.js +133 -0
  9. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +1 -1
  10. package/lib/theme/ApiExplorer/Request/index.d.ts +1 -1
  11. package/lib/theme/ApiExplorer/Response/index.d.ts +1 -1
  12. package/lib/theme/ApiExplorer/SchemaSelection/index.d.ts +2 -0
  13. package/lib/theme/ApiExplorer/SchemaSelection/index.js +36 -0
  14. package/lib/theme/ApiExplorer/SchemaSelection/slice.d.ts +37 -0
  15. package/lib/theme/ApiExplorer/SchemaSelection/slice.js +39 -0
  16. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +2 -2
  17. package/lib/theme/ApiExplorer/Server/slice.d.ts +1 -1
  18. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +1 -1
  19. package/lib/theme/ApiExplorer/index.d.ts +1 -1
  20. package/lib/theme/ApiExplorer/persistenceMiddleware.d.ts +2 -0
  21. package/lib/theme/ApiItem/hooks.d.ts +1 -0
  22. package/lib/theme/ApiItem/index.js +1 -0
  23. package/lib/theme/ApiItem/store.d.ts +6 -0
  24. package/lib/theme/ApiItem/store.js +6 -2
  25. package/lib/theme/ParamsDetails/index.js +2 -2
  26. package/lib/theme/RequestSchema/index.d.ts +1 -1
  27. package/lib/theme/RequestSchema/index.js +60 -54
  28. package/lib/theme/ResponseSchema/index.d.ts +1 -1
  29. package/lib/theme/Schema/index.d.ts +7 -1
  30. package/lib/theme/Schema/index.js +135 -9
  31. package/lib/theme/SchemaTabs/index.d.ts +8 -1
  32. package/lib/theme/SchemaTabs/index.js +10 -1
  33. package/lib/theme/StatusCodes/index.d.ts +1 -1
  34. package/lib/theme/styles.scss +10 -0
  35. package/package.json +3 -3
  36. package/src/markdown/schema.ts +6 -0
  37. package/src/theme/ApiExplorer/Authorization/slice.ts +1 -1
  38. package/src/theme/ApiExplorer/Body/FileArrayFormBodyItem/index.tsx +2 -0
  39. package/src/theme/ApiExplorer/Body/FormBodyItem/index.tsx +4 -2
  40. package/src/theme/ApiExplorer/Body/index.tsx +208 -125
  41. package/src/theme/ApiExplorer/Body/resolveSchemaWithSelections.ts +155 -0
  42. package/src/theme/ApiExplorer/FormItem/index.tsx +0 -1
  43. package/src/theme/ApiExplorer/ParamOptions/slice.ts +1 -1
  44. package/src/theme/ApiExplorer/Request/index.tsx +2 -2
  45. package/src/theme/ApiExplorer/Response/index.tsx +2 -3
  46. package/{lib/types.js → src/theme/ApiExplorer/SchemaSelection/index.ts} +7 -2
  47. package/src/theme/ApiExplorer/SchemaSelection/slice.ts +46 -0
  48. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +2 -3
  49. package/src/theme/ApiExplorer/Server/slice.ts +1 -1
  50. package/src/theme/ApiExplorer/buildPostmanRequest.ts +1 -1
  51. package/src/theme/ApiExplorer/index.tsx +1 -1
  52. package/src/theme/ApiItem/index.tsx +2 -1
  53. package/src/theme/ApiItem/store.ts +2 -0
  54. package/src/theme/ParamsDetails/index.tsx +2 -3
  55. package/src/theme/RequestSchema/index.tsx +52 -43
  56. package/src/theme/ResponseSchema/index.tsx +1 -1
  57. package/src/theme/Schema/index.tsx +186 -29
  58. package/src/theme/SchemaTabs/index.tsx +15 -4
  59. package/src/theme/StatusCodes/index.tsx +1 -2
  60. package/src/theme/styles.scss +10 -0
  61. package/src/types.d.ts +36 -0
  62. package/tsconfig.tsbuildinfo +1 -1
  63. package/lib/types.d.ts +0 -54
  64. package/src/types.ts +0 -80
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
2
+ import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
3
3
  declare function Response({ item }: {
4
4
  item: ApiItem;
5
5
  }): React.JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export { default as schemaSelectionReducer, setSchemaSelection, clearSchemaSelections, } from "./slice";
2
+ export type { SchemaSelectionState } from "./slice";
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ var __importDefault =
9
+ (this && this.__importDefault) ||
10
+ function (mod) {
11
+ return mod && mod.__esModule ? mod : { default: mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.clearSchemaSelections =
15
+ exports.setSchemaSelection =
16
+ exports.schemaSelectionReducer =
17
+ void 0;
18
+ var slice_1 = require("./slice");
19
+ Object.defineProperty(exports, "schemaSelectionReducer", {
20
+ enumerable: true,
21
+ get: function () {
22
+ return __importDefault(slice_1).default;
23
+ },
24
+ });
25
+ Object.defineProperty(exports, "setSchemaSelection", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return slice_1.setSchemaSelection;
29
+ },
30
+ });
31
+ Object.defineProperty(exports, "clearSchemaSelections", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return slice_1.clearSchemaSelections;
35
+ },
36
+ });
@@ -0,0 +1,37 @@
1
+ import { PayloadAction } from "@reduxjs/toolkit";
2
+ export interface SchemaSelectionState {
3
+ /**
4
+ * Maps schema path (e.g., "requestBody", "requestBody.anyOf.0.layer3")
5
+ * to the selected anyOf/oneOf option index
6
+ */
7
+ selections: {
8
+ [schemaPath: string]: number;
9
+ };
10
+ }
11
+ export declare const slice: import("@reduxjs/toolkit").Slice<SchemaSelectionState, {
12
+ /**
13
+ * Set the selected index for a specific schema path
14
+ */
15
+ setSchemaSelection: (state: {
16
+ selections: {
17
+ [x: string]: number;
18
+ };
19
+ }, action: PayloadAction<{
20
+ path: string;
21
+ index: number;
22
+ }>) => void;
23
+ /**
24
+ * Clear all schema selections (useful when navigating to a new API endpoint)
25
+ */
26
+ clearSchemaSelections: (state: {
27
+ selections: {
28
+ [x: string]: number;
29
+ };
30
+ }) => void;
31
+ }, "schemaSelection", "schemaSelection", import("@reduxjs/toolkit").SliceSelectors<SchemaSelectionState>>;
32
+ export declare const setSchemaSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
33
+ path: string;
34
+ index: number;
35
+ }, "schemaSelection/setSchemaSelection">, clearSchemaSelections: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"schemaSelection/clearSchemaSelections">;
36
+ declare const _default: import("redux").Reducer<SchemaSelectionState>;
37
+ export default _default;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ var _a;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.clearSchemaSelections =
11
+ exports.setSchemaSelection =
12
+ exports.slice =
13
+ void 0;
14
+ const toolkit_1 = require("@reduxjs/toolkit");
15
+ const initialState = {
16
+ selections: {},
17
+ };
18
+ exports.slice = (0, toolkit_1.createSlice)({
19
+ name: "schemaSelection",
20
+ initialState,
21
+ reducers: {
22
+ /**
23
+ * Set the selected index for a specific schema path
24
+ */
25
+ setSchemaSelection: (state, action) => {
26
+ state.selections[action.payload.path] = action.payload.index;
27
+ },
28
+ /**
29
+ * Clear all schema selections (useful when navigating to a new API endpoint)
30
+ */
31
+ clearSchemaSelections: (state) => {
32
+ state.selections = {};
33
+ },
34
+ },
35
+ });
36
+ ((_a = exports.slice.actions),
37
+ (exports.setSchemaSelection = _a.setSchemaSelection),
38
+ (exports.clearSchemaSelections = _a.clearSchemaSelections));
39
+ exports.default = exports.slice.reducer;
@@ -12,10 +12,10 @@ var __importDefault =
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const react_1 = __importDefault(require("react"));
15
- const Translate_1 = require("@docusaurus/Translate");
16
- const translationIds_1 = require("@theme/translationIds");
17
15
  const Link_1 = __importDefault(require("@docusaurus/Link"));
16
+ const Translate_1 = require("@docusaurus/Translate");
18
17
  const hooks_1 = require("@theme/ApiItem/hooks");
18
+ const translationIds_1 = require("@theme/translationIds");
19
19
  function SecuritySchemes(props) {
20
20
  const options = (0, hooks_1.useTypedSelector)((state) => state.auth.options);
21
21
  const selected = (0, hooks_1.useTypedSelector)(
@@ -1,5 +1,5 @@
1
1
  import { PayloadAction } from "@reduxjs/toolkit";
2
- import { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
2
+ import type { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
3
3
  export interface State {
4
4
  value?: ServerObject;
5
5
  options: ServerObject[];
@@ -1,6 +1,6 @@
1
1
  import { AuthState } from "@theme/ApiExplorer/Authorization/slice";
2
2
  import { Body } from "@theme/ApiExplorer/Body/slice";
3
- import { ParameterObject, ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
3
+ import type { ParameterObject, ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
4
4
  import * as sdk from "postman-collection";
5
5
  type Param = {
6
6
  value?: string | string[];
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
2
+ import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
3
3
  declare function ApiExplorer({ item, infoPath, }: {
4
4
  item: NonNullable<ApiItem>;
5
5
  infoPath: string;
@@ -8,6 +8,7 @@ export declare function createPersistenceMiddleware(options: ThemeConfig["api"])
8
8
  body: import("./Body/slice").FormBody | import("./Body/slice").RawBody | import("./Body/slice").EmptyBody;
9
9
  params: import("./ParamOptions/slice").State;
10
10
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState;
11
+ schemaSelection: import("./SchemaSelection").SchemaSelectionState;
11
12
  }, import("redux-thunk").ThunkDispatch<{
12
13
  accept: import("./Accept/slice").State;
13
14
  contentType: import("./ContentType/slice").State;
@@ -16,4 +17,5 @@ export declare function createPersistenceMiddleware(options: ThemeConfig["api"])
16
17
  body: import("./Body/slice").FormBody | import("./Body/slice").RawBody | import("./Body/slice").EmptyBody;
17
18
  params: import("./ParamOptions/slice").State;
18
19
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState;
20
+ schemaSelection: import("./SchemaSelection").SchemaSelectionState;
19
21
  }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<import("redux").UnknownAction>>;
@@ -8,5 +8,6 @@ export declare const useTypedDispatch: () => import("redux-thunk").ThunkDispatch
8
8
  body: import("../ApiExplorer/Body/slice").FormBody | import("../ApiExplorer/Body/slice").RawBody | import("../ApiExplorer/Body/slice").EmptyBody;
9
9
  params: import("../ApiExplorer/ParamOptions/slice").State;
10
10
  auth: import("../ApiExplorer/Authorization/slice").AuthState;
11
+ schemaSelection: import("../ApiExplorer/SchemaSelection").SchemaSelectionState;
11
12
  }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<import("redux").UnknownAction>;
12
13
  export declare const useTypedSelector: TypedUseSelectorHook<RootState>;
@@ -133,6 +133,7 @@ function ApiItem(props) {
133
133
  body: { type: "empty" },
134
134
  params,
135
135
  auth,
136
+ schemaSelection: { selections: {} },
136
137
  },
137
138
  [persistenceMiddleware]
138
139
  );
@@ -6,6 +6,7 @@ declare const rootReducer: import("redux").Reducer<{
6
6
  body: import("@theme/ApiExplorer/Body/slice").FormBody | import("@theme/ApiExplorer/Body/slice").RawBody | import("@theme/ApiExplorer/Body/slice").EmptyBody;
7
7
  params: import("@theme/ApiExplorer/ParamOptions/slice").State;
8
8
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState;
9
+ schemaSelection: import("@theme/ApiExplorer/SchemaSelection/slice").SchemaSelectionState;
9
10
  }, import("redux").UnknownAction, Partial<{
10
11
  accept: import("@theme/ApiExplorer/Accept/slice").State | undefined;
11
12
  contentType: import("@theme/ApiExplorer/ContentType/slice").State | undefined;
@@ -14,6 +15,7 @@ declare const rootReducer: import("redux").Reducer<{
14
15
  body: import("@theme/ApiExplorer/Body/slice").FormBody | import("@theme/ApiExplorer/Body/slice").RawBody | import("@theme/ApiExplorer/Body/slice").EmptyBody | undefined;
15
16
  params: import("@theme/ApiExplorer/ParamOptions/slice").State | undefined;
16
17
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState | undefined;
18
+ schemaSelection: import("@theme/ApiExplorer/SchemaSelection/slice").SchemaSelectionState | undefined;
17
19
  }>>;
18
20
  export type RootState = ReturnType<typeof rootReducer>;
19
21
  export declare const createStoreWithState: (preloadedState: RootState, middlewares: any[]) => import("@reduxjs/toolkit").EnhancedStore<{
@@ -24,6 +26,7 @@ export declare const createStoreWithState: (preloadedState: RootState, middlewar
24
26
  body: import("@theme/ApiExplorer/Body/slice").FormBody | import("@theme/ApiExplorer/Body/slice").RawBody | import("@theme/ApiExplorer/Body/slice").EmptyBody;
25
27
  params: import("@theme/ApiExplorer/ParamOptions/slice").State;
26
28
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState;
29
+ schemaSelection: import("@theme/ApiExplorer/SchemaSelection/slice").SchemaSelectionState;
27
30
  }, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
28
31
  dispatch: import("redux-thunk").ThunkDispatch<{
29
32
  accept: import("@theme/ApiExplorer/Accept/slice").State;
@@ -33,6 +36,7 @@ export declare const createStoreWithState: (preloadedState: RootState, middlewar
33
36
  body: import("@theme/ApiExplorer/Body/slice").FormBody | import("@theme/ApiExplorer/Body/slice").RawBody | import("@theme/ApiExplorer/Body/slice").EmptyBody;
34
37
  params: import("@theme/ApiExplorer/ParamOptions/slice").State;
35
38
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState;
39
+ schemaSelection: import("@theme/ApiExplorer/SchemaSelection/slice").SchemaSelectionState;
36
40
  }, undefined, import("redux").UnknownAction>;
37
41
  }>, import("redux").StoreEnhancer]>>;
38
42
  export declare const createStoreWithoutState: (preloadedState: {}, middlewares: any[]) => import("@reduxjs/toolkit").EnhancedStore<{
@@ -43,6 +47,7 @@ export declare const createStoreWithoutState: (preloadedState: {}, middlewares:
43
47
  body: import("@theme/ApiExplorer/Body/slice").FormBody | import("@theme/ApiExplorer/Body/slice").RawBody | import("@theme/ApiExplorer/Body/slice").EmptyBody;
44
48
  params: import("@theme/ApiExplorer/ParamOptions/slice").State;
45
49
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState;
50
+ schemaSelection: import("@theme/ApiExplorer/SchemaSelection/slice").SchemaSelectionState;
46
51
  }, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
47
52
  dispatch: import("redux-thunk").ThunkDispatch<{
48
53
  accept: import("@theme/ApiExplorer/Accept/slice").State;
@@ -52,6 +57,7 @@ export declare const createStoreWithoutState: (preloadedState: {}, middlewares:
52
57
  body: import("@theme/ApiExplorer/Body/slice").FormBody | import("@theme/ApiExplorer/Body/slice").RawBody | import("@theme/ApiExplorer/Body/slice").EmptyBody;
53
58
  params: import("@theme/ApiExplorer/ParamOptions/slice").State;
54
59
  auth: import("@theme/ApiExplorer/Authorization/slice").AuthState;
60
+ schemaSelection: import("@theme/ApiExplorer/SchemaSelection/slice").SchemaSelectionState;
55
61
  }, undefined, import("redux").UnknownAction>;
56
62
  }>, import("redux").StoreEnhancer]>>;
57
63
  export type AppDispatch = ReturnType<typeof createStoreWithState>["dispatch"];
@@ -25,15 +25,19 @@ const slice_5 = __importDefault(
25
25
  require("@theme/ApiExplorer/ParamOptions/slice")
26
26
  );
27
27
  const slice_6 = __importDefault(require("@theme/ApiExplorer/Response/slice"));
28
- const slice_7 = __importDefault(require("@theme/ApiExplorer/Server/slice"));
28
+ const slice_7 = __importDefault(
29
+ require("@theme/ApiExplorer/SchemaSelection/slice")
30
+ );
31
+ const slice_8 = __importDefault(require("@theme/ApiExplorer/Server/slice"));
29
32
  const rootReducer = (0, toolkit_1.combineReducers)({
30
33
  accept: slice_1.default,
31
34
  contentType: slice_4.default,
32
35
  response: slice_6.default,
33
- server: slice_7.default,
36
+ server: slice_8.default,
34
37
  body: slice_3.default,
35
38
  params: slice_5.default,
36
39
  auth: slice_2.default,
40
+ schemaSelection: slice_7.default,
37
41
  });
38
42
  const createStoreWithState = (preloadedState, middlewares) =>
39
43
  (0, toolkit_1.configureStore)({
@@ -12,12 +12,12 @@ var __importDefault =
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const react_1 = __importDefault(require("react"));
15
- const Translate_1 = require("@docusaurus/Translate");
16
- const translationIds_1 = require("@theme/translationIds");
17
15
  const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
16
+ const Translate_1 = require("@docusaurus/Translate");
18
17
  const Details_1 = __importDefault(require("@theme/Details"));
19
18
  const ParamsItem_1 = __importDefault(require("@theme/ParamsItem"));
20
19
  const SkeletonLoader_1 = __importDefault(require("@theme/SkeletonLoader"));
20
+ const translationIds_1 = require("@theme/translationIds");
21
21
  const ParamsDetailsComponent = ({ parameters }) => {
22
22
  const types = ["path", "query", "header", "cookie"];
23
23
  return react_1.default.createElement(
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { MediaTypeObject } from "docusaurus-plugin-openapi-docs/lib/openapi/types";
2
+ import type { MediaTypeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
3
3
  interface Props {
4
4
  style?: React.CSSProperties;
5
5
  title: string;
@@ -12,15 +12,15 @@ var __importDefault =
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const react_1 = __importDefault(require("react"));
15
- const Translate_1 = require("@docusaurus/Translate");
16
- const translationIds_1 = require("@theme/translationIds");
17
15
  const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
16
+ const Translate_1 = require("@docusaurus/Translate");
18
17
  const Details_1 = __importDefault(require("@theme/Details"));
19
18
  const Markdown_1 = __importDefault(require("@theme/Markdown"));
20
19
  const MimeTabs_1 = __importDefault(require("@theme/MimeTabs")); // Assume these components exist
21
20
  const Schema_1 = __importDefault(require("@theme/Schema"));
22
21
  const SkeletonLoader_1 = __importDefault(require("@theme/SkeletonLoader"));
23
22
  const TabItem_1 = __importDefault(require("@theme/TabItem"));
23
+ const translationIds_1 = require("@theme/translationIds");
24
24
  const RequestSchemaComponent = ({ title, body, style }) => {
25
25
  if (
26
26
  body === undefined ||
@@ -34,7 +34,7 @@ const RequestSchemaComponent = ({ title, body, style }) => {
34
34
  if (mimeTypes.length > 1) {
35
35
  return react_1.default.createElement(
36
36
  MimeTabs_1.default,
37
- { className: "openapi-tabs__mime", schemaType: "request" },
37
+ { className: "openapi-tabs__mime", schemaType: "request", lazy: true },
38
38
  mimeTypes.map((mimeType) => {
39
39
  const firstBody = body.content[mimeType].schema;
40
40
  if (
@@ -50,62 +50,67 @@ const RequestSchemaComponent = ({ title, body, style }) => {
50
50
  TabItem_1.default,
51
51
  { key: mimeType, label: mimeType, value: mimeType },
52
52
  react_1.default.createElement(
53
- Details_1.default,
54
- {
55
- className: "openapi-markdown__details mime",
56
- "data-collapsed": false,
57
- open: true,
58
- style: style,
59
- summary: react_1.default.createElement(
60
- react_1.default.Fragment,
61
- null,
62
- react_1.default.createElement(
63
- "summary",
53
+ "div",
54
+ { style: { marginTop: "1rem" } },
55
+ react_1.default.createElement(
56
+ Details_1.default,
57
+ {
58
+ className: "openapi-markdown__details mime",
59
+ "data-collapsed": false,
60
+ open: true,
61
+ style: style,
62
+ summary: react_1.default.createElement(
63
+ react_1.default.Fragment,
64
64
  null,
65
65
  react_1.default.createElement(
66
- "h3",
67
- {
68
- className:
69
- "openapi-markdown__details-summary-header-body",
70
- },
71
- (0, Translate_1.translate)({
72
- id: translationIds_1.OPENAPI_REQUEST.BODY_TITLE,
73
- message: title,
74
- }),
75
- body.required === true &&
76
- react_1.default.createElement(
77
- "span",
78
- { className: "openapi-schema__required" },
79
- (0, Translate_1.translate)({
80
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
81
- message: "required",
82
- })
83
- )
66
+ "summary",
67
+ null,
68
+ react_1.default.createElement(
69
+ "h3",
70
+ {
71
+ className:
72
+ "openapi-markdown__details-summary-header-body",
73
+ },
74
+ (0, Translate_1.translate)({
75
+ id: translationIds_1.OPENAPI_REQUEST.BODY_TITLE,
76
+ message: title,
77
+ }),
78
+ body.required === true &&
79
+ react_1.default.createElement(
80
+ "span",
81
+ { className: "openapi-schema__required" },
82
+ (0, Translate_1.translate)({
83
+ id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
84
+ message: "required",
85
+ })
86
+ )
87
+ )
84
88
  )
85
- )
86
- ),
87
- },
88
- react_1.default.createElement(
89
- "div",
90
- { style: { textAlign: "left", marginLeft: "1rem" } },
91
- body.description &&
92
- react_1.default.createElement(
93
- "div",
94
- { style: { marginTop: "1rem", marginBottom: "1rem" } },
89
+ ),
90
+ },
91
+ react_1.default.createElement(
92
+ "div",
93
+ { style: { textAlign: "left", marginLeft: "1rem" } },
94
+ body.description &&
95
95
  react_1.default.createElement(
96
- Markdown_1.default,
97
- null,
98
- body.description
96
+ "div",
97
+ { style: { marginTop: "1rem", marginBottom: "1rem" } },
98
+ react_1.default.createElement(
99
+ Markdown_1.default,
100
+ null,
101
+ body.description
102
+ )
99
103
  )
100
- )
101
- ),
102
- react_1.default.createElement(
103
- "ul",
104
- { style: { marginLeft: "1rem" } },
105
- react_1.default.createElement(Schema_1.default, {
106
- schema: firstBody,
107
- schemaType: "request",
108
- })
104
+ ),
105
+ react_1.default.createElement(
106
+ "ul",
107
+ { style: { marginLeft: "1rem" } },
108
+ react_1.default.createElement(Schema_1.default, {
109
+ schema: firstBody,
110
+ schemaType: "request",
111
+ schemaPath: "requestBody",
112
+ })
113
+ )
109
114
  )
110
115
  )
111
116
  )
@@ -184,6 +189,7 @@ const RequestSchemaComponent = ({ title, body, style }) => {
184
189
  react_1.default.createElement(Schema_1.default, {
185
190
  schema: firstBody,
186
191
  schemaType: "request",
192
+ schemaPath: "requestBody",
187
193
  })
188
194
  )
189
195
  )
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { MediaTypeObject } from "docusaurus-plugin-openapi-docs/lib/openapi/types";
2
+ import type { MediaTypeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
3
3
  interface Props {
4
4
  style?: React.CSSProperties;
5
5
  title: string;
@@ -1,8 +1,14 @@
1
1
  import React from "react";
2
- import { SchemaObject } from "docusaurus-plugin-openapi-docs/lib/openapi/types";
2
+ import type { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
3
3
  interface SchemaProps {
4
4
  schema: SchemaObject;
5
5
  schemaType: "request" | "response";
6
+ /**
7
+ * Optional path identifier for tracking anyOf/oneOf selections.
8
+ * When provided, tab selections will be dispatched to Redux state
9
+ * to enable dynamic body example updates.
10
+ */
11
+ schemaPath?: string;
6
12
  }
7
13
  declare const SchemaNode: React.FC<SchemaProps>;
8
14
  export default SchemaNode;