Add comprehensive gRPC and GraphQL support to swagger-coverage-cli #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements comprehensive support for gRPC and GraphQL APIs in swagger-coverage-cli, extending it beyond just REST/OpenAPI specifications to provide unified test coverage analysis across multiple API protocols.
Features Added
🔧 gRPC Support
.protofiles to extract service definitions and RPC methods/package.service/methodand/service/method🌐 GraphQL Support
.graphql,.gql)🚀 Enhanced Architecture
New Modules:
lib/grpc.js- Protocol Buffer parsing and gRPC operation extractionlib/graphql.js- GraphQL schema parsing and operation extractionlib/match.jswith protocol-aware matching logicCLI Improvements:
.proto,.graphql,.gql)Usage Examples
Technical Implementation
Protocol Detection & Parsing
Smart Matching Logic
matchRestRequest()- Traditional HTTP/REST API matching (existing)matchGrpcRequest()- gRPC-specific URL patterns and body validationmatchGraphQLRequest()- GraphQL query syntax and field matchingBody Validation Enhancements
Testing & Quality
Documentation Updates
Backward Compatibility
This implementation maintains complete backward compatibility. All existing OpenAPI/Swagger, CSV, and Postman collection functionality continues to work exactly as before, with no breaking changes to the API or CLI interface.
The tool now provides unified API test coverage analysis across REST, gRPC, and GraphQL protocols, making it ideal for modern microservices architectures and multi-protocol API portfolios.
Files Changed
lib/grpc.js,lib/graphql.jslib/match.js,lib/postman.js,lib/newman.js,cli.jsreadme.md,package.json✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.