schema: parseSchemaDescription()

in media/src/utils/parseAPIMetaDescription.ts [91:122]


      schema: parseSchemaDescription(param.schema as any as SemixJsonSchema, popcode, version),
    };
  }) as any[];

  const newResponseSchema = parseSchemaDescription(
    apiMeta.responses?.['200']?.schema as any as SemixJsonSchema,
    popcode,
    version,
  );

  return fp.set('responses.200.schema', newResponseSchema, result);
}

export const parseExample = (example: string) => {
  if (!example) {
    return example;
  }
  const replacements = [
    (str: string) => str?.replace(/<props="china">([\s\S]+?)<\/props>/g, isAlibabaCloud ? '' : '$1'),
    (str: string) => str?.replace(/<props="intl">([\s\S]+?)<\/props>/g, isAlibabaCloud ? '$1' : ''),
  ];
  return replacements.reduce((str, replacement) => {
    return replacement(str);
  }, example);
};

export function parseSchemaExample(schema: SemixJsonSchema) {
  if (!schema) {
    return schema;
  }
  const newSchema = SemixJsonSchema.mapSchema(schema as any, (schema) => {
    if (schema.example) {