armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Expose response headers in `DocsService`

Open hyunw9 opened this issue 8 months ago • 4 comments

Motivation

This PR addresses issue : #6187

“A response body is exposed in DocService but response headers are not. Since some APIs convey important information through response headers, exposing them in the debug console would be useful.”

Modifications

  • Modified the transport to return response headers along with the body when a request is made from the DocService’s debug console.

  • Updated the UI to display response headers in addition to the response body.

  • Changed the tooltip of the “Copy” button to say “Copy response body” for better clarity.

  • Improved API switching behavior in the debug UI

    • When the user navigates to another API and then returns to the previous one, the last debug response (body + headers) is now restored from the internal cache.
  • Screenshots

  1. Response Section
Before After
  1. Copy Response Button
Before After
  1. Improved API switching behavior

Before : When we click on another API in Docs, the existing response remains. After : When we click on another API, the response value of the previous API remains on the previous page.

Before After

Result

  • Developers can now inspect both the response headers and response body for any API directly within the DocService debug console.

hyunw9 avatar Apr 05 '25 14:04 hyunw9

🔍 Build Scan® (commit: d1ac966338f108aa8647b9971696cc2bcfb8f20b)

Job name Status Build Scan®
build-ubicloud-standard-16-jdk-8 https://ge.armeria.dev/s/dxrw45ox2axkm
build-ubicloud-standard-16-jdk-21-snapshot-blockhound https://ge.armeria.dev/s/256ji52wuayrc
build-ubicloud-standard-16-jdk-17-min-java-17-coverage https://ge.armeria.dev/s/egchrdzcpl7to
build-ubicloud-standard-16-jdk-17-min-java-11 https://ge.armeria.dev/s/kua3s3o6u7f4i
build-ubicloud-standard-16-jdk-17-leak https://ge.armeria.dev/s/d5b74eeetmxxo
build-ubicloud-standard-16-jdk-11 https://ge.armeria.dev/s/l4ekfszfb2oy6
build-macos-latest-jdk-21 https://ge.armeria.dev/s/4marghbthqxjq

github-actions[bot] avatar Apr 05 '25 14:04 github-actions[bot]

Would you mind share the screenshot or screencast that demonstrates the change for easier reviews?

trustin avatar Apr 07 '25 09:04 trustin

Would you mind share the screenshot or screencast that demonstrates the change for easier reviews?

Sure! I've just added a screenshot to make it easier to understand.

hyunw9 avatar Apr 07 '25 10:04 hyunw9

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.60%. Comparing base (8150425) to head (add4c40). Report is 61 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6191      +/-   ##
============================================
+ Coverage     74.46%   74.60%   +0.14%     
- Complexity    22234    22470     +236     
============================================
  Files          1963     1972       +9     
  Lines         82437    82992     +555     
  Branches      10764    10798      +34     
============================================
+ Hits          61385    61915     +530     
- Misses        15918    15931      +13     
- Partials       5134     5146      +12     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 09 '25 13:04 codecov[bot]