Skip to content

fix: show additional info panel when contact has url but no email - #3006

Open
SB-virendrasolanke wants to merge 2 commits into
mainfrom
stop-6698-fix-contact-information-email-is-not-provided
Open

SB-virendrasolanke wants to merge 2 commits into
mainfrom
stop-6698-fix-contact-information-email-is-not-provided

Conversation

@SB-virendrasolanke

Copy link
Copy Markdown
Contributor

Motivation and Context

STOP-6698

API contact information was not displayed in the UI when the OpenAPI specification provided a contact name/url without an email address. Per the OpenAPI Contact Object definition, email is optional, so a contact with only name/url is valid and should still be rendered.

Description

In HttpService.tsx, the "Additional Information" panel (AdditionalInfo) was gated by a condition that only checked data.contact?.email:

{(data.contact?.email || data.license || data.termsOfService) && (
  <AdditionalInfo ... />
)}

If a contact had only name + url (no email), this condition evaluated to false and the panel never rendered, even though AdditionalInfo itself already knows how to build a [Contact <name>](<url>) link from name + url alone.

Updated the condition to also check data.contact?.url, so the panel renders whenever either email or url is present:

{(data.contact?.email || data.contact?.url || data.license || data.termsOfService) && (
  <AdditionalInfo ... />
)}

No changes were needed inside AdditionalInfo.tsx — its existing logic already prioritizes name + url over email when both exist, and falls back gracefully (returns null) if no contact/license/ToS data is available.

How Has This Been Tested?

  • Verified locally that a spec with contact.name + contact.url (no email) now renders the "Additional Information" panel with a [Contact <name>](<url>) link.
  • Verified existing behavior is unchanged for specs with email only, license, and termsOfService.
  • Confirmed the panel still does not render when none of contact, license, or termsOfService are present.

Screenshot(s)/recordings(s)

Before adding URL condition -
Screenshot 2026-10-28 at 5 07 45 PM

After Adding URL OR condition -
Screenshot 2026-10-28 at 5 07 28 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • This PR's code follows as closely as possible the coding style/guidelines of this project.
  • I have added error reporting and followed the error reporting guidelines.
  • I have added event tracking and followed the event tracking guidelines.
  • I have updated any internal docs to reflect this PR's changes.
  • If this PR affects existing features or includes UI changes, I have reached out to the Tech Writers team OR added the s/needs-docs label.
  • I have added automated tests (unit/integration/e2e/other) to cover my changes.
  • All new and existing tests pass locally (excluding flaky CI tests).
  • If this PR completes a story or makes a substantial UX change, demo it to the Product Manager.

@netlify

netlify Bot commented Oct 28, 2026

Copy link
Copy Markdown

✅ Deploy Preview for stoplight-elements ready!

Name Link
🔨 Latest commit 5bf1443
🔍 Latest deploy log https://app.netlify.com/projects/stoplight-elements/deploys/6ae1dee661ca702b671adb34
😎 Deploy Preview https://deploy-preview-3006--stoplight-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 28, 2026

Copy link
Copy Markdown

✅ Deploy Preview for stoplight-elements-demo ready!

Name Link
🔨 Latest commit 5bf1443
🔍 Latest deploy log https://app.netlify.com/projects/stoplight-elements-demo/deploys/6ae1dee6f25b62e164a87a5e
😎 Deploy Preview https://deploy-preview-3006--stoplight-elements-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

<Box data-test="additional-info">
{(data.contact?.email || data.license || data.termsOfService) && (
{(data.contact?.email || data.contact?.url || data.license || data.termsOfService) && (
<AdditionalInfo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In AdditionalInfo component also changes will be required ?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants