File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/components/ParserOpenRPC/DetailsBox Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,18 @@ const getRefSchemaFromComponents = (initRef, components) => {
1212const renderSchema = ( schemaItem , schemas , name ) => {
1313 if ( ! schemaItem ) return < div > Invalid schema</ div >
1414
15- const resolveRef = ref => {
15+ const resolveRef = ( ref , originalItem ) => {
1616 const newSchema = getRefSchemaFromComponents ( ref , schemas )
17- return renderSchema ( newSchema , schemas , name )
17+ // Preserve the original parameter's description when resolving references
18+ const resolvedSchema = {
19+ ...newSchema ,
20+ description : originalItem ?. description || newSchema . description || newSchema . title || '' ,
21+ }
22+ return renderSchema ( resolvedSchema , schemas , name )
1823 }
1924
20- if ( schemaItem ?. schema ?. $ref ) return resolveRef ( schemaItem . schema . $ref )
21- if ( schemaItem ?. $ref ) return resolveRef ( schemaItem . $ref )
25+ if ( schemaItem ?. schema ?. $ref ) return resolveRef ( schemaItem . schema . $ref , schemaItem )
26+ if ( schemaItem ?. $ref ) return resolveRef ( schemaItem . $ref , schemaItem )
2227
2328 const renderObject = ( item , itemName ) => {
2429 const requiredFields = Array . isArray ( item . required ) ? item . required : [ ]
You can’t perform that action at this time.
0 commit comments