1
1
2
2
/**
3
3
* @preserve
4
- * RapiDoc 9.1.8 - WebComponent to View OpenAPI docs
4
+ * RapiDoc 9.2.0-beta - WebComponent to View OpenAPI docs
5
5
* License: MIT
6
6
* Repo : https://github.com/mrin9/RapiDoc
7
7
* Author : Mrinmoy Majumdar
@@ -28973,6 +28973,44 @@ function schemaToSampleObj(schema, config = {}) {
28973
28973
28974
28974
return obj;
28975
28975
}
28976
+
28977
+ function generateMarkdownForArrayAndObjectDescription(schema, level = 0) {
28978
+ var _schema$items5;
28979
+
28980
+ let markdown = '';
28981
+
28982
+ if (schema.title) {
28983
+ markdown = `**${schema.title}:** `;
28984
+ }
28985
+
28986
+ if (schema.minItems) {
28987
+ markdown = `${markdown} **Min Items:** ${schema.minItems}`;
28988
+ }
28989
+
28990
+ if (schema.maxItems) {
28991
+ markdown = `${markdown} **Max Items:** ${schema.maxItems}`;
28992
+ }
28993
+
28994
+ if (schema.description) {
28995
+ markdown = `${markdown} ${schema.description}`;
28996
+ }
28997
+
28998
+ if (level > 0 && (_schema$items5 = schema.items) !== null && _schema$items5 !== void 0 && _schema$items5.description) {
28999
+ let itemsMarkdown = '';
29000
+
29001
+ if (schema.items.minProperties) {
29002
+ itemsMarkdown = `**Min Properties:** ${schema.items.minProperties}`;
29003
+ }
29004
+
29005
+ if (schema.items.maxProperties) {
29006
+ itemsMarkdown = `${itemsMarkdown} **Max Properties:** ${schema.items.maxProperties}`;
29007
+ }
29008
+
29009
+ markdown = `${markdown} ⮕ ${itemsMarkdown} [ ${schema.items.description} ] `;
29010
+ }
29011
+
29012
+ return markdown;
29013
+ }
28976
29014
/**
28977
29015
* For changing OpenAPI-Schema to an Object Notation,
28978
29016
* This Object would further be an input to UI Components to generate an Object-Tree
@@ -28982,6 +29020,7 @@ function schemaToSampleObj(schema, config = {}) {
28982
29020
* @param {string} suffix - used for suffixing property names to avoid duplicate props during object composion
28983
29021
*/
28984
29022
29023
+
28985
29024
function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
28986
29025
if (!schema) {
28987
29026
return;
@@ -29104,6 +29143,7 @@ function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
29104
29143
} else if (v === 'object') {
29105
29144
// If object type iterate all the properties and create an object-type-option
29106
29145
const objTypeOption = {
29146
+ '::title': schema.title || '',
29107
29147
'::description': schema.description || '',
29108
29148
'::type': 'object',
29109
29149
'::deprecated': schema.deprecated || false
@@ -29120,6 +29160,7 @@ function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
29120
29160
multiTypeOptions[`::OPTION~${i + 1}`] = objTypeOption;
29121
29161
} else if (v === 'array') {
29122
29162
multiTypeOptions[`::OPTION~${i + 1}`] = {
29163
+ '::title': schema.title || '',
29123
29164
'::description': schema.description || '',
29124
29165
'::type': 'array',
29125
29166
'::props': schemaInObjectNotation(schema.items, {}, level + 1)
@@ -29130,7 +29171,9 @@ function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
29130
29171
obj['::ONE~OF'] = multiTypeOptions;
29131
29172
}
29132
29173
} else if (schema.type === 'object' || schema.properties) {
29133
- obj['::description'] = schema.description || '';
29174
+ // If Object
29175
+ obj['::title'] = schema.title || '';
29176
+ obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);
29134
29177
obj['::type'] = 'object';
29135
29178
obj['::deprecated'] = schema.deprecated || false;
29136
29179
obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';
@@ -29147,10 +29190,9 @@ function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
29147
29190
obj['<any-key>'] = schemaInObjectNotation(schema.additionalProperties, {});
29148
29191
}
29149
29192
} else if (schema.type === 'array' || schema.items) {
29150
- var _schema$items5;
29151
-
29152
29193
// If Array
29153
- obj['::description'] = schema.description ? schema.description : (_schema$items5 = schema.items) !== null && _schema$items5 !== void 0 && _schema$items5.description ? `array<${schema.items.description}>` : '';
29194
+ obj['::title'] = schema.title || '';
29195
+ obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);
29154
29196
obj['::type'] = 'array';
29155
29197
obj['::deprecated'] = schema.deprecated || false;
29156
29198
obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';
@@ -29307,6 +29349,15 @@ function generateExample(schema, mimeType, examples = '', example = '', includeR
29307
29349
exampleValue
29308
29350
});
29309
29351
}
29352
+ } else if (mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('jose')) {
29353
+ finalExamples.push({
29354
+ exampleId: 'Example',
29355
+ exampleSummary: 'Base64 Encoded',
29356
+ exampleDescription: '',
29357
+ exampleType: mimeType,
29358
+ exampleValue: schema.pattern || 'bXJpbg==',
29359
+ exampleFormat: 'text'
29360
+ });
29310
29361
} else {
29311
29362
finalExamples.push({
29312
29363
exampleId: 'Example',
@@ -29853,7 +29904,7 @@ class SchemaTree extends lit_element_s {
29853
29904
<div class='inside-bracket ${data['::type'] || 'no-type-info'}' style='padding-left:${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' ? 0 : leftPadding}px;'>
29854
29905
${Array.isArray(data) && data[0] ? $`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, data[0]['::readwrite'])}` : $`
29855
29906
${Object.keys(data).map(dataKey => $`
29856
- ${['::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite'].includes(dataKey) ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object' ? $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}` : '' : $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}`}
29907
+ ${['::title', ':: description', '::type', '::props', '::deprecated', '::array-type', '::readwrite'].includes(dataKey) ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object' ? $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}` : '' : $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}`}
29857
29908
`)}
29858
29909
`}
29859
29910
</div>
@@ -29862,7 +29913,7 @@ class SchemaTree extends lit_element_s {
29862
29913
} // For Primitive types and array of Primitives
29863
29914
29864
29915
29865
- const [type, primitiveReadOrWrite, constraint, defaultValue, allowedValues, pattern, schemaDescription,, deprecated] = data.split('~|~');
29916
+ const [type, primitiveReadOrWrite, constraint, defaultValue, allowedValues, pattern, schemaDescription, schemaTitle , deprecated] = data.split('~|~');
29866
29917
29867
29918
if (primitiveReadOrWrite === '🆁' && this.schemaHideReadOnly === 'true') {
29868
29919
return;
@@ -29907,7 +29958,7 @@ class SchemaTree extends lit_element_s {
29907
29958
${defaultValue ? $`<div style='display:inline-block; line-break:anywhere; margin-right:8px'><span class='bold-text'>Default: </span>${defaultValue}</div>` : ''}
29908
29959
${allowedValues ? $`<div style='display:inline-block; line-break:anywhere; margin-right:8px'><span class='bold-text'>Allowed: </span>${allowedValues}</div>` : ''}
29909
29960
${pattern ? $`<div style='display:inline-block; line-break: anywhere; margin-right:8px'><span class='bold-text'>Pattern: </span>${pattern}</div>` : ''}
29910
- ${schemaDescription ? $`<span class="m-markdown-small">${unsafe_html_o(marked(schemaDescription))}</span>` : ''}
29961
+ ${schemaDescription ? $`<span class="m-markdown-small">${unsafe_html_o(marked(`${schemaTitle ? `**${schemaTitle}:**` : ''} ${ schemaDescription}` ))}</span>` : ''}
29911
29962
</div>
29912
29963
</div>
29913
29964
`;
@@ -30667,7 +30718,7 @@ class ApiRequest extends lit_element_s {
30667
30718
let schemaAsObj;
30668
30719
let reqBodyExamples = [];
30669
30720
30670
- if (this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text')) {
30721
+ if (this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose') ) {
30671
30722
// Generate Example
30672
30723
if (reqBody.mimeType === this.selectedRequestBodyType) {
30673
30724
reqBodyExamples = generateExample(reqBody.schema, reqBody.mimeType, reqBody.examples, reqBody.example, false, true, 'text', false);
@@ -30734,7 +30785,7 @@ class ApiRequest extends lit_element_s {
30734
30785
} // Generate Schema
30735
30786
30736
30787
30737
- if (reqBody.mimeType.includes('json') || reqBody.mimeType.includes('xml') || reqBody.mimeType.includes('text')) {
30788
+ if (reqBody.mimeType.includes('json') || reqBody.mimeType.includes('xml') || reqBody.mimeType.includes('text') || this.selectedRequestBodyType.includes('jose') ) {
30738
30789
schemaAsObj = schemaInObjectNotation(reqBody.schema, {});
30739
30790
30740
30791
if (this.schemaStyle === 'table') {
@@ -30778,7 +30829,7 @@ class ApiRequest extends lit_element_s {
30778
30829
</div>
30779
30830
${this.request_body.description ? $`<div class="m-markdown" style="margin-bottom:12px">${unsafe_html_o(marked(this.request_body.description))}</div>` : ''}
30780
30831
30781
- ${this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') ? $`
30832
+ ${this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose') ? $`
30782
30833
<div class="tab-panel col" style="border-width:0 0 1px 0;">
30783
30834
<div class="tab-buttons row" @click="${e => {
30784
30835
if (e.target.tagName.toLowerCase() === 'button') {
@@ -31881,7 +31932,7 @@ class SchemaTable extends lit_element_s {
31881
31932
<div class='object-body'>
31882
31933
${Array.isArray(data) && data[0] ? $`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, '')}` : $`
31883
31934
${Object.keys(data).map(dataKey => $`
31884
- ${['::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite'].includes(dataKey) ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object' ? $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}` : '' : $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}`}
31935
+ ${['::title', ':: description', '::type', '::props', '::deprecated', '::array-type', '::readwrite'].includes(dataKey) ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object' ? $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}` : '' : $`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}`}
31885
31936
`)}
31886
31937
`}
31887
31938
<div>
@@ -31926,7 +31977,7 @@ class SchemaTable extends lit_element_s {
31926
31977
${defaultValue ? $`<div style='display:inline-block; line-break:anywhere; margin-right:8px;'> <span class='bold-text'>Default: </span>${defaultValue}</div>` : ''}
31927
31978
${allowedValues ? $`<div style='display:inline-block; line-break:anywhere; margin-right:8px;'> <span class='bold-text'>Allowed: </span>${allowedValues}</div>` : ''}
31928
31979
${pattern ? $`<div style='display:inline-block; line-break:anywhere; margin-right:8px;'> <span class='bold-text'>Pattern: </span>${pattern}</div>` : ''}
31929
- ${schemaDescription ? $`<span class="m-markdown-small">${unsafe_html_o(marked(schemaDescription))}</span>` : ''}
31980
+ ${schemaDescription ? $`<span class="m-markdown-small">${unsafe_html_o(marked(`${schemaTitle ? `**${schemaTitle}:**` : ''} ${ schemaDescription}` ))}</span>` : ''}
31930
31981
</div>
31931
31982
</div>
31932
31983
`;
@@ -42016,7 +42067,7 @@ Prism.languages.js = Prism.languages.javascript;
42016
42067
/******/
42017
42068
/******/ /* webpack/runtime/getFullHash */
42018
42069
/******/ (() => {
42019
- /******/ __webpack_require__.h = () => ("5c0e179872605ca38c72 ")
42070
+ /******/ __webpack_require__.h = () => ("27ebe4f6ce7b32ad2722 ")
42020
42071
/******/ })();
42021
42072
/******/
42022
42073
/******/ /* webpack/runtime/global */
0 commit comments