MCPcopy Index your code
hub / github.com/rapi-doc/RapiDoc / addSchemaInfoToExample

Function addSchemaInfoToExample

src/utils/schema-utils.js:418–434  ·  view source on GitHub ↗
(schema, obj)

Source from the content-addressed store, hash-verified

416}
417
418function addSchemaInfoToExample(schema, obj) {
419 if (typeof obj !== 'object' || obj === null) {
420 return;
421 }
422 if (schema.title) {
423 obj['::TITLE'] = schema.title;
424 }
425 if (schema.description) {
426 obj['::DESCRIPTION'] = schema.description;
427 }
428 if (schema.xml?.name) {
429 obj['::XML_TAG'] = schema.xml?.name;
430 }
431 if (schema.xml?.wrapped) {
432 obj['::XML_WRAP'] = schema.xml?.wrapped.toString();
433 }
434}
435
436function removeTitlesAndDescriptions(obj) {
437 if (typeof obj !== 'object' || obj === null) {

Callers 1

schemaToSampleObjFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…