Skip to content

Release v8.0.2

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Oct 21:04
· 0 commits to ca6e854e01fd8e4585b94e39a12768205a9ec3d6 since this release

πŸš€ swagger-coverage-cli v8.0.2

✨ New Features

  • πŸ“ Folder-Level Tests Support: Tests defined at folder level in Postman collections are now automatically applied to all requests within that folder
  • πŸ”„ Recursive Test Inheritance: Support for nested folder hierarchies with test inheritance across multiple levels
  • πŸ›‘οΈ Flexible Spec Validation: New --disable-spec-validation flag to process specs with validation or reference issues

🎨 Enhanced Features

  • Better Coverage Calculation: More accurate coverage metrics by including folder-level test assertions
  • Reduced Test Duplication: Define common tests once at folder level instead of repeating on every request
  • Enterprise Collection Support: Improved support for well-organized Postman collections with folder structures
  • Legacy API Support: Work with incomplete or invalid specs using --disable-spec-validation

πŸ“ Folder-Level Tests

Postman collections organized into folders can now have tests defined at the folder level that automatically apply to all child requests:

{
  "name": "User API",
  "item": [
    { "name": "Get Users", "request": {...} },
    { "name": "Create User", "request": {...} }
  ],
  "event": [{
    "listen": "test",
    "script": {
      "exec": ["pm.expect(pm.response.code).to.be.oneOf([200, 201]);"]
    }
  }]
}

Benefits:

  • βœ… Both requests inherit status codes 200 and 201 from folder
  • βœ… Folder tests combine with request-level tests
  • βœ… Supports unlimited nesting depth
  • βœ… Backward compatible with existing collections

πŸ›‘οΈ Spec Validation Control

The new --disable-spec-validation flag allows you to analyze coverage even when specs have validation issues:

# Skip validation for specs with broken references or validation errors
swagger-coverage-cli api.yaml collection.json --disable-spec-validation

Use cases:

  • Legacy APIs with incomplete specifications
  • Specs with external references that can't be resolved
  • APIs in development where specs aren't fully complete
  • Quick coverage checks without fixing all spec issues first

🎯 Protocol Support

πŸ“‹ REST/OpenAPI

  • OpenAPI v2/v3 specifications (YAML/JSON)
  • Smart path matching with parameter variations
  • Request body and query parameter validation
  • Multiple status codes per operation

⚑ gRPC

  • Protocol Buffer (.proto) file parsing
  • Service and method extraction
  • HTTP/2 path mapping (/package.service/method)
  • Content-type validation (application/grpc)

πŸ”€ GraphQL

  • GraphQL schema (.graphql/.gql) parsing
  • Query, mutation, and subscription extraction
  • Type system with arguments and unions
  • Unified /graphql endpoint handling

πŸš€ Usage Examples

# Single protocol APIs
swagger-coverage-cli api.yaml collection.json           # OpenAPI/REST
swagger-coverage-cli service.proto collection.json     # gRPC
swagger-coverage-cli schema.graphql collection.json    # GraphQL

# Mixed protocol APIs (Enterprise-ready)
swagger-coverage-cli "api.yaml,service.proto,schema.graphql" collection.json

# All existing options work across protocols
swagger-coverage-cli "api.yaml,service.proto" collection.json --verbose --strict-body

πŸ”§ Compatibility

  • βœ… Maintains backwards compatibility with existing workflows
  • βœ… Node.js 14+ required
  • βœ… NPM package available globally
  • βœ… Smart mapping enabled by default
  • βœ… All existing CLI options work with new protocols

πŸ“¦ Installation

npm install -g swagger-coverage-cli@8.0.2

πŸ§ͺ Quality Assurance

  • 198 Tests: Comprehensive test suite covering all protocols, scenarios, folder-level tests, and spec validation control
  • 22 Test Suites: Dedicated test coverage for each protocol, integration scenarios, validation features, and edge cases
  • Folder Tests Coverage: 18 tests specifically for folder-level test extraction including deep nesting, empty folders, and mixed patterns
  • Edge Case Coverage: Robust handling of malformed URLs, missing data, broken references, complex scenarios, and various Postman collection structures
  • Performance Tested: Validated with large datasets, mixed protocol specifications, and deeply nested folder hierarchies
  • Protocol Isolation: Each protocol's parsing and matching logic is independently tested
  • Validation Testing: Comprehensive tests for --disable-spec-validation flag covering unit and CLI integration

Full Changelog: v1.0.0...v8.0.2