Skip to content

Conversation

@alexpmule
Copy link
Contributor

@alexpmule alexpmule commented Feb 4, 2026

Summary

Moves gRPC API detection and try-it panel hiding logic from ApiConsole.js to ApiConsoleApp.js while maintaining the functionality in both components. Also adds missing test coverage for gRPC detection in ApiConsole.js.

This PR is part of a two-part fix:

  1. Replicate gRPC detection in api-console-app (work started by Lean but not published)
  2. Implement logic in api-documentation to hide the try-it button when dealing with a gRPC API

Changes

  • Added gRPC detection (_isGrpcApi()) check in ApiConsole._processModelChange() to hide try-it panel for gRPC APIs
  • Added call to _updateRenderInlineTyit() in ApiConsoleApp._processModelChange() to ensure try-it panel visibility is updated when AMF model changes
  • Both components now properly handle gRPC API detection and hide the try-it panel accordingly

Testing

  • Added comprehensive test suite for gRPC API support in ApiConsole.js (test/api-console.amf.test.js)
    • Verifies _noTryItValue is set correctly for gRPC APIs
    • Tests gRPC API detection (_isGrpcApi())
    • Ensures try-it button is hidden when selecting methods in gRPC APIs
  • Root Cause: The missing test coverage in ApiConsole.js allowed the gRPC detection logic to go untested when using ApiConsole directly (without ApiConsoleApp), which is why this issue was not caught earlier

Dependencies

  • Bumping @api-components/api-documentation version (to be updated once the companion PR in api-documentation is published)
    • The api-documentation component will also implement gRPC detection logic to hide the try-it button at the component level

@alexpmule alexpmule changed the title W-21176653 Move gRPC API detection and try panel hiding logic to ApiConsoleApp @W-21176653 Move gRPC API detection and try panel hiding logic to ApiConsoleApp Feb 4, 2026
@alexpmule alexpmule self-assigned this Feb 4, 2026
@alexpmule alexpmule marked this pull request as ready for review February 4, 2026 18:18
@alexpmule alexpmule requested a review from a team as a code owner February 4, 2026 18:18
@alexpmule alexpmule merged commit 4bf0e3d into master Feb 4, 2026
8 checks passed
@alexpmule alexpmule deleted the move-grpc-detection-to-api-console-app branch February 4, 2026 18:29
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