Skip to content

Commit

Permalink
Merge pull request #258 from Authress-Engineering/improve-all-of-title
Browse files Browse the repository at this point in the history
If schema title and description are set for all of by default use that. fix #257.
  • Loading branch information
wparad authored Jul 5, 2024
2 parents 0403ae2 + c04ed5c commit a3f1577
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/schema-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
});

const obj = schemaInObjectNotation(schema, options, 0);
return Object.assign({}, objWithAllProps, typeof obj === 'object' && !Array.isArray(obj) ? obj : {});
const resultObj = typeof obj === 'object' && !Array.isArray(obj) ? obj : {};
// These are the only valuable properties from allOf, everything else isn't going to be available, otherwise fallback to whatever was there from the children objects
resultObj['::title'] = schema.title || resultObj['::title'];
resultObj['::description'] = schema.description || resultObj['::description'];
return Object.assign({}, objWithAllProps, resultObj);
}

if (anyOf || oneOf) {
Expand Down

0 comments on commit a3f1577

Please sign in to comment.