api-manager icon indicating copy to clipboard operation
api-manager copied to clipboard

API Overview shows '-' (no description) when the description type is markdown

Open msm1992 opened this issue 4 years ago • 3 comments

Description:

API Overview shows '-' (no description) when the description type is markdown. This gives an impression that the description is not defined.

Screenshot 2021-04-19 at 14 01 59

However when type is changes to text for the same markdown text (## This is a simple API for Pizza Shack online pizza delivery store.), it is interpreted as markdown in the overview UI.

Screenshot 2021-04-19 at 14 04 57

Steps to reproduce:

Affected Product Version:

Environment details (with versions):

  • OS:
  • Client:
  • Env (Docker/K8s):

Optional Fields

Related Issues:

Suggested Labels:

Suggested Assignees:

msm1992 avatar Apr 19 '21 08:04 msm1992

Still valid issue

Krishanx92 avatar Dec 11 '24 06:12 Krishanx92

Related Issue: https://github.com/wso2/api-manager/issues/3526

hisanhunais avatar Jan 21 '25 06:01 hisanhunais

Fix in Version 4.6.0

The issue has been resolved by removing the buggy type selector entirely and implementing unified markdown rendering.

Changes Made:

1. Description Type Selector Removed

  • No more "Markdown" vs "Text" type selection
  • Single description field for all APIs

2. Automatic Markdown Rendering via ReactMarkdown

File: portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/NewOverview/MetaData.jsx

Line 23: Import ReactMarkdown

import ReactMarkdown from 'react-markdown';

Lines 100-122: Unified description rendering
<Typography component='p' variant='body1'>
    {api.description && (
        <ReactMarkdown>{capitalizeFirstLetter(api.description)}</ReactMarkdown>
    )}
</Typography>
<Typography component='p' variant='body1' className={parentClasses.notConfigured}>
    {!api.description && (
        <FormattedMessage
            id='Apis.Details.NewOverview.MetaData.description.not.set'
            defaultMessage='-'
        />
    )}
</Typography>

Key Changes:
- ✅ All descriptions now use ReactMarkdown component for rendering
- ✅ The "-" placeholder only shows when description is truly empty (correct behavior)
- ✅ No more type-based conditional logic

---
Current Behavior (4.6.0)

- No type selector - Users simply add content to the description field
- Automatic markdown detection - Any markdown syntax is automatically rendered
- Plain text support - Plain text without markdown syntax displays normally
- Consistent behavior - Works the same way for all APIs

🤖 Generated with [Claude Code](https://claude.ai/code)

ranuka-laksika avatar Nov 21 '25 06:11 ranuka-laksika