docusaurus-plugin-openapi-docs 0.0.0-457 → 0.0.0-459

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/lib/index.js CHANGED
@@ -155,7 +155,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
155
155
  const tagMdTemplate = `---
156
156
  id: {{{id}}}
157
157
  title: {{{description}}}
158
- description: {{{description}}}
158
+ description: "{{{description}}}"
159
159
  custom_edit_url: null
160
160
  ---
161
161
 
@@ -43,7 +43,7 @@ exports.mergeAllOf = mergeAllOf;
43
43
  */
44
44
  function createAnyOneOf(schema) {
45
45
  const type = schema.oneOf ? "oneOf" : "anyOf";
46
- return (0, utils_1.create)("li", {
46
+ return (0, utils_1.create)("div", {
47
47
  children: [
48
48
  (0, utils_1.create)("div", {
49
49
  children: [
@@ -44,7 +44,7 @@ exports.mergeAllOf = mergeAllOf;
44
44
  */
45
45
  function createAnyOneOf(schema) {
46
46
  const type = schema.oneOf ? "oneOf" : "anyOf";
47
- return (0, utils_1.create)("li", {
47
+ return (0, utils_1.create)("div", {
48
48
  children: [
49
49
  (0, utils_1.create)("div", {
50
50
  children: [
@@ -68,7 +68,7 @@ function createResponseHeaders(responseHeaders) {
68
68
  Object.entries(responseHeaders).map(([headerName, headerObj]) => {
69
69
  const { description, schema: { type }, example, } = headerObj;
70
70
  return (0, utils_1.create)("li", {
71
- class: "schemaItem",
71
+ className: "schemaItem",
72
72
  children: [
73
73
  (0, createDetailsSummary_1.createDetailsSummary)({
74
74
  children: [
@@ -59,7 +59,7 @@ async function createPostmanCollection(openapiData) {
59
59
  return await jsonToCollection(data);
60
60
  }
61
61
  function createItems(openapiData, sidebarOptions) {
62
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
62
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
63
63
  // TODO: Find a better way to handle this
64
64
  let items = [];
65
65
  const infoId = (0, kebabCase_1.default)(openapiData.info.title);
@@ -95,7 +95,9 @@ function createItems(openapiData, sidebarOptions) {
95
95
  id: infoId,
96
96
  unversionedId: infoId,
97
97
  title: openapiData.info.title,
98
- description: openapiData.info.description,
98
+ description: openapiData.info.description
99
+ ? openapiData.info.description.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
100
+ : "",
99
101
  frontMatter: {},
100
102
  securitySchemes: (_b = openapiData.components) === null || _b === void 0 ? void 0 : _b.securitySchemes,
101
103
  info: {
@@ -155,7 +157,9 @@ function createItems(openapiData, sidebarOptions) {
155
157
  infoId: infoId !== null && infoId !== void 0 ? infoId : "",
156
158
  unversionedId: baseId,
157
159
  title: title,
158
- description: (_q = operationObject.description) !== null && _q !== void 0 ? _q : "",
160
+ description: operationObject.description
161
+ ? operationObject.description.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
162
+ : "",
159
163
  frontMatter: {},
160
164
  api: {
161
165
  ...defaults,
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": "0.0.0-457",
4
+ "version": "0.0.0-459",
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": "d5c212c06c1a726af5f29ed0128be9d4e77a477c"
71
+ "gitHead": "d8f9b2012115b7f64eb6e8f545dce8c416cf3635"
72
72
  }
package/src/index.ts CHANGED
@@ -191,7 +191,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
191
191
  const tagMdTemplate = `---
192
192
  id: {{{id}}}
193
193
  title: {{{description}}}
194
- description: {{{description}}}
194
+ description: "{{{description}}}"
195
195
  custom_edit_url: null
196
196
  ---
197
197
 
@@ -46,7 +46,7 @@ export function mergeAllOf(allOf: SchemaObject[]) {
46
46
  */
47
47
  function createAnyOneOf(schema: SchemaObject): any {
48
48
  const type = schema.oneOf ? "oneOf" : "anyOf";
49
- return create("li", {
49
+ return create("div", {
50
50
  children: [
51
51
  create("div", {
52
52
  children: [
@@ -51,7 +51,7 @@ export function mergeAllOf(allOf: SchemaObject[]) {
51
51
  */
52
52
  function createAnyOneOf(schema: SchemaObject): any {
53
53
  const type = schema.oneOf ? "oneOf" : "anyOf";
54
- return create("li", {
54
+ return create("div", {
55
55
  children: [
56
56
  create("div", {
57
57
  children: [
@@ -70,7 +70,7 @@ function createResponseHeaders(responseHeaders: any) {
70
70
  }: any = headerObj;
71
71
 
72
72
  return create("li", {
73
- class: "schemaItem",
73
+ className: "schemaItem",
74
74
  children: [
75
75
  createDetailsSummary({
76
76
  children: [
@@ -119,7 +119,12 @@ function createItems(
119
119
  id: infoId,
120
120
  unversionedId: infoId,
121
121
  title: openapiData.info.title,
122
- description: openapiData.info.description,
122
+ description: openapiData.info.description
123
+ ? openapiData.info.description.replace(
124
+ /((?:^|[^\\])(?:\\{2})*)"/g,
125
+ "$1'"
126
+ )
127
+ : "",
123
128
  frontMatter: {},
124
129
  securitySchemes: openapiData.components?.securitySchemes,
125
130
  info: {
@@ -194,7 +199,12 @@ function createItems(
194
199
  infoId: infoId ?? "",
195
200
  unversionedId: baseId,
196
201
  title: title,
197
- description: operationObject.description ?? "",
202
+ description: operationObject.description
203
+ ? operationObject.description.replace(
204
+ /((?:^|[^\\])(?:\\{2})*)"/g,
205
+ "$1'"
206
+ )
207
+ : "",
198
208
  frontMatter: {},
199
209
  api: {
200
210
  ...defaults,