docusaurus-theme-openapi-docs 0.0.0-1293 → 0.0.0-1295

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 (62) hide show
  1. package/lib/markdown/schema.js +38 -15
  2. package/lib/markdown/schema.test.js +35 -0
  3. package/lib/theme/ApiExplorer/Authorization/index.js +9 -10
  4. package/lib/theme/ApiExplorer/Body/index.js +4 -5
  5. package/lib/theme/ApiExplorer/Export/index.js +9 -2
  6. package/lib/theme/ApiExplorer/FormFileUpload/index.js +1 -2
  7. package/lib/theme/ApiExplorer/FormLabel/index.js +1 -2
  8. package/lib/theme/ApiExplorer/FormTextInput/index.js +1 -2
  9. package/lib/theme/ApiExplorer/LiveEditor/index.js +1 -2
  10. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +5 -3
  11. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +1 -2
  12. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +1 -2
  13. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +1 -2
  14. package/lib/theme/ApiExplorer/ParamOptions/index.js +2 -3
  15. package/lib/theme/ApiExplorer/Request/index.js +17 -18
  16. package/lib/theme/ApiExplorer/Response/index.js +7 -11
  17. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +57 -50
  18. package/lib/theme/ApiExplorer/Server/index.js +2 -3
  19. package/lib/theme/ApiTabs/index.js +1 -2
  20. package/lib/theme/Example/index.js +3 -4
  21. package/lib/theme/ParamsDetails/index.js +1 -2
  22. package/lib/theme/ParamsItem/index.js +7 -8
  23. package/lib/theme/RequestSchema/index.js +4 -6
  24. package/lib/theme/ResponseExamples/index.js +3 -4
  25. package/lib/theme/ResponseSchema/index.js +2 -3
  26. package/lib/theme/Schema/index.js +8 -9
  27. package/lib/theme/SchemaExpansion/index.js +4 -5
  28. package/lib/theme/SchemaItem/index.js +9 -10
  29. package/lib/theme/StatusCodes/index.js +2 -4
  30. package/lib/theme/translationIds.d.ts +1 -99
  31. package/lib/theme/translationIds.js +0 -116
  32. package/package.json +3 -3
  33. package/src/markdown/schema.test.ts +41 -0
  34. package/src/markdown/schema.ts +42 -15
  35. package/src/theme/ApiExplorer/Authorization/index.tsx +9 -10
  36. package/src/theme/ApiExplorer/Body/index.tsx +7 -5
  37. package/src/theme/ApiExplorer/Export/index.tsx +6 -2
  38. package/src/theme/ApiExplorer/FormFileUpload/index.tsx +1 -2
  39. package/src/theme/ApiExplorer/FormLabel/index.tsx +1 -2
  40. package/src/theme/ApiExplorer/FormTextInput/index.tsx +1 -2
  41. package/src/theme/ApiExplorer/LiveEditor/index.tsx +1 -2
  42. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +5 -3
  43. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +1 -2
  44. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +1 -2
  45. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +1 -2
  46. package/src/theme/ApiExplorer/ParamOptions/index.tsx +2 -3
  47. package/src/theme/ApiExplorer/Request/index.tsx +23 -18
  48. package/src/theme/ApiExplorer/Response/index.tsx +10 -8
  49. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +60 -52
  50. package/src/theme/ApiExplorer/Server/index.tsx +8 -3
  51. package/src/theme/ApiTabs/index.tsx +1 -2
  52. package/src/theme/Example/index.tsx +3 -4
  53. package/src/theme/ParamsDetails/index.tsx +1 -2
  54. package/src/theme/ParamsItem/index.tsx +13 -8
  55. package/src/theme/RequestSchema/index.tsx +4 -5
  56. package/src/theme/ResponseExamples/index.tsx +3 -4
  57. package/src/theme/ResponseSchema/index.tsx +2 -3
  58. package/src/theme/Schema/index.tsx +8 -9
  59. package/src/theme/SchemaExpansion/index.tsx +4 -5
  60. package/src/theme/SchemaItem/index.tsx +18 -10
  61. package/src/theme/StatusCodes/index.tsx +2 -3
  62. package/src/theme/translationIds.ts +37 -113
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.getSchemaName = getSchemaName;
10
10
  exports.getQualifierMessage = getQualifierMessage;
11
11
  const Translate_1 = require("@docusaurus/Translate");
12
- const translationIds_1 = require("../theme/translationIds");
13
12
  /**
14
13
  * Extracts enum values from a schema, including when wrapped in allOf.
15
14
  */
@@ -42,13 +41,36 @@ function getTypeFromSchema(schema) {
42
41
  }
43
42
  return undefined;
44
43
  }
44
+ // OpenAPI 3.1 / JSON Schema 2020-12 allows `type` to be an array of type names
45
+ // (e.g. `["string", "null"]`). Normalize to a single name and a pretty-printed
46
+ // union form joined with ` | `.
47
+ function normalizeType(type) {
48
+ if (Array.isArray(type)) {
49
+ const filtered = type.filter((t) => typeof t === "string");
50
+ if (filtered.length === 0)
51
+ return { isUnion: false };
52
+ if (filtered.length === 1)
53
+ return { single: filtered[0], isUnion: false };
54
+ return { pretty: filtered.join(" | "), isUnion: true };
55
+ }
56
+ if (typeof type === "string")
57
+ return { single: type, isUnion: false };
58
+ return { isUnion: false };
59
+ }
45
60
  function prettyName(schema, circular) {
46
61
  // Handle enum-only schemas (valid in JSON Schema)
47
62
  // When enum is present without explicit type, treat as string
48
63
  if (schema.enum && !schema.type) {
49
64
  return "string";
50
65
  }
66
+ const t = normalizeType(schema.type);
51
67
  if (schema.format) {
68
+ if (t.single) {
69
+ return `${t.single}<${schema.format}>`;
70
+ }
71
+ if (t.isUnion) {
72
+ return `(${t.pretty})<${schema.format}>`;
73
+ }
52
74
  return schema.format;
53
75
  }
54
76
  if (schema.allOf) {
@@ -72,22 +94,23 @@ function prettyName(schema, circular) {
72
94
  if (schema.anyOf) {
73
95
  return "object";
74
96
  }
75
- if (schema.type === "object") {
76
- return schema.xml?.name ?? schema.type;
77
- // return schema.type;
97
+ if (t.single === "object") {
98
+ return schema.xml?.name ?? t.single;
78
99
  }
79
- if (schema.type === "array") {
80
- return schema.xml?.name ?? schema.type;
81
- // return schema.type;
100
+ if (t.single === "array") {
101
+ return schema.xml?.name ?? t.single;
82
102
  }
83
- if (Array.isArray(schema.type)) {
84
- return schema.type.join(" | ");
103
+ if (t.isUnion) {
104
+ return t.pretty;
85
105
  }
86
- return schema.title ?? schema.type;
106
+ return schema.title ?? t.single;
87
107
  }
88
108
  function getSchemaName(schema, circular) {
89
109
  if (schema.items) {
90
- return getSchemaName(schema.items, circular) + "[]";
110
+ const items = schema.items;
111
+ const inner = getSchemaName(items, circular);
112
+ const needsParens = Array.isArray(items.type) && items.type.length > 1;
113
+ return needsParens ? `(${inner})[]` : `${inner}[]`;
91
114
  }
92
115
  return prettyName(schema, circular) ?? "";
93
116
  }
@@ -106,7 +129,7 @@ function getQualifierMessage(schema) {
106
129
  return getQualifierMessage(schema.items);
107
130
  }
108
131
  let message = `**${(0, Translate_1.translate)({
109
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.POSSIBLE_VALUES,
132
+ id: "theme.openapi.schemaItem.possibleValues",
110
133
  message: "Possible values:",
111
134
  })}** `;
112
135
  let qualifierGroups = [];
@@ -122,11 +145,11 @@ function getQualifierMessage(schema) {
122
145
  let minLength;
123
146
  let maxLength;
124
147
  const charactersMessage = (0, Translate_1.translate)({
125
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.CHARACTERS,
148
+ id: "theme.openapi.schemaItem.characters",
126
149
  message: "characters",
127
150
  });
128
151
  const nonEmptyMessage = (0, Translate_1.translate)({
129
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.NON_EMPTY,
152
+ id: "theme.openapi.schemaItem.nonEmpty",
130
153
  message: "non-empty",
131
154
  });
132
155
  if (schema.minLength && schema.minLength > 1) {
@@ -187,7 +210,7 @@ function getQualifierMessage(schema) {
187
210
  }
188
211
  if (schema.pattern) {
189
212
  const expressionMessage = (0, Translate_1.translate)({
190
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.EXPRESSION,
213
+ id: "theme.openapi.schemaItem.expression",
191
214
  message: "Value must match regular expression",
192
215
  });
193
216
  qualifierGroups.push(`${expressionMessage} \`${schema.pattern}\``);
@@ -48,4 +48,39 @@ describe("getSchemaName", () => {
48
48
  };
49
49
  expect((0, schema_1.getSchemaName)(schema)).toBe("integer[][][]");
50
50
  });
51
+ it("joins OpenAPI 3.1 type arrays with ` | ` (issue #950)", () => {
52
+ const schema = { type: ["string", "null"] };
53
+ expect((0, schema_1.getSchemaName)(schema)).toBe("string | null");
54
+ });
55
+ it("unwraps a single-element type array", () => {
56
+ const schema = { type: ["integer"] };
57
+ expect((0, schema_1.getSchemaName)(schema)).toBe("integer");
58
+ });
59
+ it("renders single type with format as `type<format>`", () => {
60
+ const schema = {
61
+ type: "string",
62
+ format: "uuid",
63
+ };
64
+ expect((0, schema_1.getSchemaName)(schema)).toBe("string<uuid>");
65
+ });
66
+ it("renders type union with format", () => {
67
+ const schema = {
68
+ type: ["string", "null"],
69
+ format: "uuid",
70
+ };
71
+ expect((0, schema_1.getSchemaName)(schema)).toBe("(string | null)<uuid>");
72
+ });
73
+ it("resolves type from an allOf wrapper that contains an enum", () => {
74
+ const schema = {
75
+ allOf: [{ type: "string", enum: ["a", "b"] }],
76
+ };
77
+ expect((0, schema_1.getSchemaName)(schema)).toBe("string");
78
+ });
79
+ it("renders array of items whose type is a union", () => {
80
+ const schema = {
81
+ type: "array",
82
+ items: { type: ["string", "null"] },
83
+ };
84
+ expect((0, schema_1.getSchemaName)(schema)).toBe("(string | null)[]");
85
+ });
51
86
  });
@@ -19,7 +19,6 @@ const FormTextInput_1 = __importDefault(
19
19
  require("@theme/ApiExplorer/FormTextInput")
20
20
  );
21
21
  const hooks_1 = require("@theme/ApiItem/hooks");
22
- const translationIds_1 = require("@theme/translationIds");
23
22
  const slice_1 = require("./slice");
24
23
  function Authorization() {
25
24
  const data = (0, hooks_1.useTypedSelector)((state) => state.auth.data);
@@ -42,7 +41,7 @@ function Authorization() {
42
41
  null,
43
42
  react_1.default.createElement(FormSelect_1.default, {
44
43
  label: (0, Translate_1.translate)({
45
- id: translationIds_1.OPENAPI_AUTH.SECURITY_SCHEME,
44
+ id: "theme.openapi.auth.securityScheme",
46
45
  message: "Security Scheme",
47
46
  }),
48
47
  options: optionKeys,
@@ -59,11 +58,11 @@ function Authorization() {
59
58
  { key: a.key + "-bearer" },
60
59
  react_1.default.createElement(FormTextInput_1.default, {
61
60
  label: (0, Translate_1.translate)({
62
- id: translationIds_1.OPENAPI_AUTH.BEARER_TOKEN,
61
+ id: "theme.openapi.auth.bearerToken",
63
62
  message: "Bearer Token",
64
63
  }),
65
64
  placeholder: (0, Translate_1.translate)({
66
- id: translationIds_1.OPENAPI_AUTH.BEARER_TOKEN,
65
+ id: "theme.openapi.auth.bearerToken",
67
66
  message: "Bearer Token",
68
67
  }),
69
68
  password: true,
@@ -87,11 +86,11 @@ function Authorization() {
87
86
  { key: a.key + "-oauth2" },
88
87
  react_1.default.createElement(FormTextInput_1.default, {
89
88
  label: (0, Translate_1.translate)({
90
- id: translationIds_1.OPENAPI_AUTH.BEARER_TOKEN,
89
+ id: "theme.openapi.auth.bearerToken",
91
90
  message: "Bearer Token",
92
91
  }),
93
92
  placeholder: (0, Translate_1.translate)({
94
- id: translationIds_1.OPENAPI_AUTH.BEARER_TOKEN,
93
+ id: "theme.openapi.auth.bearerToken",
95
94
  message: "Bearer Token",
96
95
  }),
97
96
  password: true,
@@ -118,11 +117,11 @@ function Authorization() {
118
117
  null,
119
118
  react_1.default.createElement(FormTextInput_1.default, {
120
119
  label: (0, Translate_1.translate)({
121
- id: translationIds_1.OPENAPI_AUTH.USERNAME,
120
+ id: "theme.openapi.auth.username",
122
121
  message: "Username",
123
122
  }),
124
123
  placeholder: (0, Translate_1.translate)({
125
- id: translationIds_1.OPENAPI_AUTH.USERNAME,
124
+ id: "theme.openapi.auth.username",
126
125
  message: "Username",
127
126
  }),
128
127
  value: data[a.key].username ?? "",
@@ -143,11 +142,11 @@ function Authorization() {
143
142
  null,
144
143
  react_1.default.createElement(FormTextInput_1.default, {
145
144
  label: (0, Translate_1.translate)({
146
- id: translationIds_1.OPENAPI_AUTH.PASSWORD,
145
+ id: "theme.openapi.auth.password",
147
146
  message: "Password",
148
147
  }),
149
148
  placeholder: (0, Translate_1.translate)({
150
- id: translationIds_1.OPENAPI_AUTH.PASSWORD,
149
+ id: "theme.openapi.auth.password",
151
150
  message: "Password",
152
151
  }),
153
152
  password: true,
@@ -79,7 +79,6 @@ const hooks_1 = require("@theme/ApiItem/hooks");
79
79
  const Markdown_1 = __importDefault(require("@theme/Markdown"));
80
80
  const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
81
81
  const TabItem_1 = __importDefault(require("@theme/TabItem"));
82
- const translationIds_1 = require("@theme/translationIds");
83
82
  const createSchemaExample_1 = require("docusaurus-plugin-openapi-docs/lib/openapi/createSchemaExample");
84
83
  const xml_formatter_1 = __importDefault(require("xml-formatter"));
85
84
  const FormBodyItem_1 = __importDefault(require("./FormBodyItem"));
@@ -340,7 +339,7 @@ function Body({
340
339
  placeholder:
341
340
  schema.description ||
342
341
  (0, Translate_1.translate)({
343
- id: translationIds_1.OPENAPI_REQUEST.BODY_TITLE,
342
+ id: "theme.openapi.request.body.title",
344
343
  message: "Body",
345
344
  }),
346
345
  onChange: (file) => {
@@ -373,7 +372,7 @@ function Body({
373
372
  TabItem_1.default,
374
373
  {
375
374
  label: (0, Translate_1.translate)({
376
- id: translationIds_1.OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
375
+ id: "theme.openapi.body.exampleFromSchema",
377
376
  message: "Example (from schema)",
378
377
  }),
379
378
  value: "Example (from schema)",
@@ -465,7 +464,7 @@ function Body({
465
464
  TabItem_1.default,
466
465
  {
467
466
  label: (0, Translate_1.translate)({
468
- id: translationIds_1.OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
467
+ id: "theme.openapi.body.exampleFromSchema",
469
468
  message: "Example (from schema)",
470
469
  }),
471
470
  value: "Example (from schema)",
@@ -517,7 +516,7 @@ function Body({
517
516
  TabItem_1.default,
518
517
  {
519
518
  label: (0, Translate_1.translate)({
520
- id: translationIds_1.OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
519
+ id: "theme.openapi.body.exampleFromSchema",
521
520
  message: "Example (from schema)",
522
521
  }),
523
522
  value: "Example (from schema)",
@@ -12,6 +12,7 @@ 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");
15
16
  const file_saver_1 = __importDefault(require("file-saver"));
16
17
  const saveFile = (url) => {
17
18
  let fileName;
@@ -30,7 +31,10 @@ function Export({ url, proxy }) {
30
31
  react_1.default.createElement(
31
32
  "button",
32
33
  { className: "export-button button button--sm button--secondary" },
33
- "Export"
34
+ (0, Translate_1.translate)({
35
+ id: "theme.openapi.export.button",
36
+ message: "Export",
37
+ })
34
38
  ),
35
39
  react_1.default.createElement(
36
40
  "ul",
@@ -48,7 +52,10 @@ function Export({ url, proxy }) {
48
52
  className: "dropdown__link",
49
53
  href: `${url}`,
50
54
  },
51
- "OpenAPI Spec"
55
+ (0, Translate_1.translate)({
56
+ id: "theme.openapi.export.openapiSpec",
57
+ message: "OpenAPI Spec",
58
+ })
52
59
  )
53
60
  )
54
61
  )
@@ -72,7 +72,6 @@ const Translate_1 = require("@docusaurus/Translate");
72
72
  const FloatingButton_1 = __importDefault(
73
73
  require("@theme/ApiExplorer/FloatingButton")
74
74
  );
75
- const translationIds_1 = require("@theme/translationIds");
76
75
  const react_magic_dropzone_1 = __importDefault(require("react-magic-dropzone"));
77
76
  function RenderPreview({ file }) {
78
77
  switch (file.type) {
@@ -161,7 +160,7 @@ function FormFileUpload({ placeholder, onChange }) {
161
160
  },
162
161
  },
163
162
  (0, Translate_1.translate)({
164
- id: translationIds_1.OPENAPI_FORM_FILE_UPLOAD.CLEAR_BUTTON,
163
+ id: "theme.openapi.formFileUpload.clearButton",
165
164
  message: "Clear",
166
165
  })
167
166
  ),
@@ -13,7 +13,6 @@ var __importDefault =
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const react_1 = __importDefault(require("react"));
15
15
  const Translate_1 = require("@docusaurus/Translate");
16
- const translationIds_1 = require("@theme/translationIds");
17
16
  function FormLabel({ htmlFor, label, type, required }) {
18
17
  return react_1.default.createElement(
19
18
  react_1.default.Fragment,
@@ -41,7 +40,7 @@ function FormLabel({ htmlFor, label, type, required }) {
41
40
  "span",
42
41
  { className: "openapi-schema__required" },
43
42
  (0, Translate_1.translate)({
44
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
43
+ id: "theme.openapi.schemaItem.required",
45
44
  message: "required",
46
45
  })
47
46
  )
@@ -72,7 +72,6 @@ const react_1 = __importStar(require("react"));
72
72
  const Translate_1 = require("@docusaurus/Translate");
73
73
  const error_message_1 = require("@hookform/error-message");
74
74
  const FormLabel_1 = __importDefault(require("@theme/ApiExplorer/FormLabel"));
75
- const translationIds_1 = require("@theme/translationIds");
76
75
  const clsx_1 = __importDefault(require("clsx"));
77
76
  const react_hook_form_1 = require("react-hook-form");
78
77
  function FormTextInput({
@@ -108,7 +107,7 @@ function FormTextInput({
108
107
  ...register(paramName, {
109
108
  required: isRequired
110
109
  ? (0, Translate_1.translate)({
111
- id: translationIds_1.OPENAPI_FORM.FIELD_REQUIRED,
110
+ id: "theme.openapi.form.fieldRequired",
112
111
  message: "This field is required",
113
112
  })
114
113
  : false,
@@ -72,7 +72,6 @@ const theme_common_1 = require("@docusaurus/theme-common");
72
72
  const Translate_1 = require("@docusaurus/Translate");
73
73
  const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
74
74
  const error_message_1 = require("@hookform/error-message");
75
- const translationIds_1 = require("@theme/translationIds");
76
75
  const clsx_1 = __importDefault(require("clsx"));
77
76
  const react_hook_form_1 = require("react-hook-form");
78
77
  const react_live_1 = require("react-live");
@@ -144,7 +143,7 @@ function App({
144
143
  required:
145
144
  isRequired && !code
146
145
  ? (0, Translate_1.translate)({
147
- id: translationIds_1.OPENAPI_FORM.FIELD_REQUIRED,
146
+ id: "theme.openapi.form.fieldRequired",
148
147
  message: "This field is required",
149
148
  })
150
149
  : false,
@@ -79,7 +79,6 @@ const FormTextInput_1 = __importDefault(
79
79
  );
80
80
  const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
81
81
  const hooks_1 = require("@theme/ApiItem/hooks");
82
- const translationIds_1 = require("@theme/translationIds");
83
82
  const react_hook_form_1 = require("react-hook-form");
84
83
  function ArrayItem({ param, onChange, initialValue }) {
85
84
  const [value, setValue] = (0, react_1.useState)(initialValue || "");
@@ -171,7 +170,7 @@ function ParamArrayFormItem({ param, label, type, required }) {
171
170
  rules: {
172
171
  required: param.required
173
172
  ? (0, Translate_1.translate)({
174
- id: translationIds_1.OPENAPI_FORM.FIELD_REQUIRED,
173
+ id: "theme.openapi.form.fieldRequired",
175
174
  message: "This field is required",
176
175
  })
177
176
  : false,
@@ -219,7 +218,10 @@ function ParamArrayFormItem({ param, label, type, required }) {
219
218
  react_1.default.createElement(
220
219
  "button",
221
220
  { className: "openapi-explorer__thin-btn", onClick: handleAddItem },
222
- "Add item"
221
+ (0, Translate_1.translate)({
222
+ id: "theme.openapi.paramArray.addItem",
223
+ message: "Add item",
224
+ })
223
225
  )
224
226
  ),
225
227
  }),
@@ -74,7 +74,6 @@ const error_message_1 = require("@hookform/error-message");
74
74
  const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
75
75
  const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
76
76
  const hooks_1 = require("@theme/ApiItem/hooks");
77
- const translationIds_1 = require("@theme/translationIds");
78
77
  const react_hook_form_1 = require("react-hook-form");
79
78
  function ParamBooleanFormItem({ param, label, type, required }) {
80
79
  const dispatch = (0, hooks_1.useTypedDispatch)();
@@ -106,7 +105,7 @@ function ParamBooleanFormItem({ param, label, type, required }) {
106
105
  rules: {
107
106
  required: param.required
108
107
  ? (0, Translate_1.translate)({
109
- id: translationIds_1.OPENAPI_FORM.FIELD_REQUIRED,
108
+ id: "theme.openapi.form.fieldRequired",
110
109
  message: "This field is required",
111
110
  })
112
111
  : false,
@@ -21,7 +21,6 @@ const FormMultiSelect_1 = __importDefault(
21
21
  const ParamOptions_1 = require("@theme/ApiExplorer/ParamOptions");
22
22
  const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
23
23
  const hooks_1 = require("@theme/ApiItem/hooks");
24
- const translationIds_1 = require("@theme/translationIds");
25
24
  const react_hook_form_1 = require("react-hook-form");
26
25
  function ParamMultiSelectFormItem({ param, label, type, required }) {
27
26
  const {
@@ -70,7 +69,7 @@ function ParamMultiSelectFormItem({ param, label, type, required }) {
70
69
  rules: {
71
70
  required: param.required
72
71
  ? (0, Translate_1.translate)({
73
- id: translationIds_1.OPENAPI_FORM.FIELD_REQUIRED,
72
+ id: "theme.openapi.form.fieldRequired",
74
73
  message: "This field is required",
75
74
  })
76
75
  : false,
@@ -75,7 +75,6 @@ const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
75
75
  const ParamOptions_1 = require("@theme/ApiExplorer/ParamOptions");
76
76
  const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
77
77
  const hooks_1 = require("@theme/ApiItem/hooks");
78
- const translationIds_1 = require("@theme/translationIds");
79
78
  const react_hook_form_1 = require("react-hook-form");
80
79
  function ParamSelectFormItem({ param, label, type, required }) {
81
80
  const {
@@ -100,7 +99,7 @@ function ParamSelectFormItem({ param, label, type, required }) {
100
99
  rules: {
101
100
  required: param.required
102
101
  ? (0, Translate_1.translate)({
103
- id: translationIds_1.OPENAPI_FORM.FIELD_REQUIRED,
102
+ id: "theme.openapi.form.fieldRequired",
104
103
  message: "This field is required",
105
104
  })
106
105
  : false,
@@ -87,7 +87,6 @@ const ParamTextFormItem_1 = __importDefault(
87
87
  require("@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem")
88
88
  );
89
89
  const hooks_1 = require("@theme/ApiItem/hooks");
90
- const translationIds_1 = require("@theme/translationIds");
91
90
  /**
92
91
  * Extracts enum values from a schema, including when wrapped in allOf.
93
92
  * This handles cases where an enum is referenced via allOf for composition.
@@ -254,11 +253,11 @@ function ParamOptions() {
254
253
  ),
255
254
  showOptional
256
255
  ? (0, Translate_1.translate)({
257
- id: translationIds_1.OPENAPI_PARAM_OPTIONS.HIDE_OPTIONAL,
256
+ id: "theme.openapi.paramOptions.hideOptional",
258
257
  message: "Hide optional parameters",
259
258
  })
260
259
  : (0, Translate_1.translate)({
261
- id: translationIds_1.OPENAPI_PARAM_OPTIONS.SHOW_OPTIONAL,
260
+ id: "theme.openapi.paramOptions.showOptional",
262
261
  message: "Show optional parameters",
263
262
  })
264
263
  ),
@@ -85,14 +85,13 @@ const buildPostmanRequest_1 = __importDefault(
85
85
  const ContentType_1 = __importDefault(
86
86
  require("@theme/ApiExplorer/ContentType")
87
87
  );
88
+ const useResolvedEncoding_1 = require("@theme/ApiExplorer/EncodingSelection/useResolvedEncoding");
88
89
  const ParamOptions_1 = __importDefault(
89
90
  require("@theme/ApiExplorer/ParamOptions")
90
91
  );
91
92
  const slice_1 = require("@theme/ApiExplorer/Response/slice");
92
93
  const Server_1 = __importDefault(require("@theme/ApiExplorer/Server"));
93
- const useResolvedEncoding_1 = require("@theme/ApiExplorer/EncodingSelection/useResolvedEncoding");
94
94
  const hooks_1 = require("@theme/ApiItem/hooks");
95
- const translationIds_1 = require("@theme/translationIds");
96
95
  const sdk = __importStar(require("postman-collection"));
97
96
  const react_hook_form_1 = require("react-hook-form");
98
97
  const makeRequest_1 = __importStar(require("./makeRequest"));
@@ -200,26 +199,26 @@ function Request({ item }) {
200
199
  switch (errorType) {
201
200
  case "timeout":
202
201
  return (0, Translate_1.translate)({
203
- id: translationIds_1.OPENAPI_REQUEST.ERROR_TIMEOUT,
202
+ id: "theme.openapi.request.error.timeout",
204
203
  message:
205
204
  "The request timed out waiting for the server to respond. Please try again. If the issue persists, try using a different client (e.g., curl) with a longer timeout.",
206
205
  });
207
206
  case "network":
208
207
  return (0, Translate_1.translate)({
209
- id: translationIds_1.OPENAPI_REQUEST.ERROR_NETWORK,
208
+ id: "theme.openapi.request.error.network",
210
209
  message:
211
210
  "Unable to reach the server. Please check your network connection and verify the server URL is correct. If the server is running, this may be a CORS issue.",
212
211
  });
213
212
  case "cors":
214
213
  return (0, Translate_1.translate)({
215
- id: translationIds_1.OPENAPI_REQUEST.ERROR_CORS,
214
+ id: "theme.openapi.request.error.cors",
216
215
  message:
217
216
  "The request was blocked, possibly due to CORS restrictions. Ensure the server allows requests from this origin, or try using a proxy.",
218
217
  });
219
218
  case "unknown":
220
219
  default:
221
220
  return (0, Translate_1.translate)({
222
- id: translationIds_1.OPENAPI_REQUEST.ERROR_UNKNOWN,
221
+ id: "theme.openapi.request.error.unknown",
223
222
  message:
224
223
  "An unexpected error occurred while making the request. Please try again.",
225
224
  });
@@ -229,7 +228,7 @@ function Request({ item }) {
229
228
  dispatch(
230
229
  (0, slice_1.setResponse)(
231
230
  (0, Translate_1.translate)({
232
- id: translationIds_1.OPENAPI_REQUEST.FETCHING_MESSAGE,
231
+ id: "theme.openapi.request.fetchingMessage",
233
232
  message: "Fetching...",
234
233
  })
235
234
  )
@@ -256,7 +255,7 @@ function Request({ item }) {
256
255
  errorMessage = getErrorMessage(e.type);
257
256
  } else {
258
257
  errorMessage = (0, Translate_1.translate)({
259
- id: translationIds_1.OPENAPI_REQUEST.CONNECTION_FAILED,
258
+ id: "theme.openapi.request.connectionFailed",
260
259
  message: "Connection failed",
261
260
  });
262
261
  }
@@ -314,7 +313,7 @@ function Request({ item }) {
314
313
  "span",
315
314
  { className: "openapi-explorer__request-title" },
316
315
  (0, Translate_1.translate)({
317
- id: translationIds_1.OPENAPI_REQUEST.REQUEST_TITLE,
316
+ id: "theme.openapi.request.title",
318
317
  message: "Request",
319
318
  })
320
319
  ),
@@ -327,7 +326,7 @@ function Request({ item }) {
327
326
  onClick: collapseAllDetails,
328
327
  },
329
328
  (0, Translate_1.translate)({
330
- id: translationIds_1.OPENAPI_REQUEST.COLLAPSE_ALL,
329
+ id: "theme.openapi.request.collapseAll",
331
330
  message: "Collapse all",
332
331
  })
333
332
  )
@@ -339,7 +338,7 @@ function Request({ item }) {
339
338
  onClick: expandAllDetails,
340
339
  },
341
340
  (0, Translate_1.translate)({
342
- id: translationIds_1.OPENAPI_REQUEST.EXPAND_ALL,
341
+ id: "theme.openapi.request.expandAll",
343
342
  message: "Expand all",
344
343
  })
345
344
  )
@@ -366,7 +365,7 @@ function Request({ item }) {
366
365
  },
367
366
  },
368
367
  (0, Translate_1.translate)({
369
- id: translationIds_1.OPENAPI_REQUEST.BASE_URL_TITLE,
368
+ id: "theme.openapi.request.baseUrl.title",
370
369
  message: "Base URL",
371
370
  })
372
371
  ),
@@ -391,7 +390,7 @@ function Request({ item }) {
391
390
  },
392
391
  },
393
392
  (0, Translate_1.translate)({
394
- id: translationIds_1.OPENAPI_REQUEST.AUTH_TITLE,
393
+ id: "theme.openapi.request.auth.title",
395
394
  message: "Auth",
396
395
  })
397
396
  ),
@@ -415,7 +414,7 @@ function Request({ item }) {
415
414
  },
416
415
  },
417
416
  (0, Translate_1.translate)({
418
- id: translationIds_1.OPENAPI_REQUEST.PARAMETERS_TITLE,
417
+ id: "theme.openapi.request.parameters.title",
419
418
  message: "Parameters",
420
419
  })
421
420
  ),
@@ -438,7 +437,7 @@ function Request({ item }) {
438
437
  },
439
438
  },
440
439
  (0, Translate_1.translate)({
441
- id: translationIds_1.OPENAPI_REQUEST.BODY_TITLE,
440
+ id: "theme.openapi.request.body.title",
442
441
  message: "Body",
443
442
  }),
444
443
  requestBodyRequired &&
@@ -447,7 +446,7 @@ function Request({ item }) {
447
446
  { className: "openapi-schema__required" },
448
447
  "\u00A0",
449
448
  (0, Translate_1.translate)({
450
- id: translationIds_1.OPENAPI_REQUEST.REQUIRED_LABEL,
449
+ id: "theme.openapi.request.requiredLabel",
451
450
  message: "required",
452
451
  })
453
452
  )
@@ -480,7 +479,7 @@ function Request({ item }) {
480
479
  },
481
480
  },
482
481
  (0, Translate_1.translate)({
483
- id: translationIds_1.OPENAPI_REQUEST.ACCEPT_TITLE,
482
+ id: "theme.openapi.request.accept.title",
484
483
  message: "Accept",
485
484
  })
486
485
  ),
@@ -492,7 +491,7 @@ function Request({ item }) {
492
491
  "button",
493
492
  { className: "openapi-explorer__request-btn", type: "submit" },
494
493
  (0, Translate_1.translate)({
495
- id: translationIds_1.OPENAPI_REQUEST.SEND_BUTTON,
494
+ id: "theme.openapi.request.sendButton",
496
495
  message: "Send API Request",
497
496
  })
498
497
  )