@@ -40,8 +40,9 @@ export const wrapSpecWithI18n = (
4040 const method = Object . keys ( paths [ p ] ) [ 0 ]
4141 const operationObj = paths [ p ] [ method ] as OpenAPIV3 . OperationObject ;
4242 const { description, summary } = apiDoc ;
43- operationObj . description = description ;
44- operationObj . summary = summary ;
43+ const { description : originDes , summary : originSum } = operationObj ;
44+ operationObj . description = description || originDes ;
45+ operationObj . summary = summary || originSum ;
4546 const example = swaggerSpecExample [ p ] || { } ;
4647 if ( example ) {
4748 operationObj [ "x-codeSamples" ] = [
@@ -88,7 +89,8 @@ export const wrapSpecWithI18n = (
8889 schema : components . schemas [ s ] ,
8990 prefix : [ "components" , "schemas" , s ] ,
9091 describeFn : ( { prefix, path } ) => {
91- _ . set ( cloneSpec , [ ...prefix , "description" ] , schema [ path ] ) ;
92+ const originDes = _ . get ( cloneSpec , [ ...prefix , 'description' ] ) ;
93+ _ . set ( cloneSpec , [ ...prefix , "description" ] , schema [ path ] || originDes ) ;
9294 } ,
9395 } ) ;
9496 } ) ;
0 commit comments