public List validate()

in oas-validator/oas-validator-style/src/main/java/org/apache/servicecomb/toolkit/oasv/style/validator/openapi/OpenApiVersionGteValidator.java [49:64]


  public List<OasViolation> validate(OasValidationContext context, OasObjectPropertyLocation location, OpenAPI openAPI) {

    if (openAPI.getOpenapi() == null) {
      return singletonList(new OasViolation(location.property("openapi"), ViolationMessages.REQUIRED));
    }

    String[] semver = openAPI.getOpenapi().split("\\.");
    String[] expectedSemver = versionGte.split("\\.");
    boolean ok = semver[0].equals(expectedSemver[0])
        && semver[1].equals(expectedSemver[1])
        && Integer.parseInt(semver[2]) >= Integer.valueOf(expectedSemver[2]);
    if (ok) {
      return emptyList();
    }
    return singletonList(new OasViolation(location.property("openapi"), ERROR + versionGte));
  }