Swagger Contract Version Matches Client (SL004)

Ensures swagger.contract.version in service modules matches the corresponding -client module version.

Description

For multi-module projects, checks service module POMs for the swagger.contract.version property and validates it equals the -client module version.

Rationale

Contract compatibility depends on version alignment between clients and services.

Findings

  • ERROR

    • swagger.contract.version does not match client module version

Noncompliant

Mismatched swagger.contract.version
<!-- Service module pom.xml with mismatched swagger.contract.version -->
<project>
  <properties>
    <swagger.contract.version>1.2.0</swagger.contract.version>
  </properties>
</project>
<!-- client module version is 1.3.0 -->

Compliant

Matching swagger.contract.version
<!-- Service module pom.xml with matching swagger.contract.version -->
<project>
  <properties>
    <swagger.contract.version>1.3.0</swagger.contract.version>
  </properties>
</project>
<!-- client module version is 1.3.0 -->

Configuration

This rule has no configuration.