viclovsky/swagger-coverage

Maven artifact doesn't expose a transitive dep for io.swagger.core.v3

sskorol opened this issue · 0 comments

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

Compilation fails with 1.4.1 version published to Sonatype due to missing io.swagger.core.v3 dependency.

If the current behavior is a bug, please provide steps to reproduce, broken swagger specification and swagger-coverage-output:

  • use mavenCentral() instead of jcenter
  • add implementation("com.github.viclovsky:swagger-coverage-rest-assured:1.4.1") dependency
  • implement an OrderedFilter
  • try to access CoverageOutputWriter from within a filter class
  • compile

What is the expected behavior?

swagger-coverage library should include all required artifacts for successful compilation

What is the motivation / use case for changing the behavior?

Broken build

Other information

The following interface refers to OpenAPI class which is missing while compilation.

package com.github.viclovsky.swagger.coverage;

import io.swagger.models.Swagger;
import io.swagger.v3.oas.models.OpenAPI;

public interface CoverageOutputWriter {

    void write(Swagger swagger);

    void write(OpenAPI openAPI);

}

As a dirty fix, one can explicitely add implementation("io.swagger.core.v3:swagger-core:2.1.10") dependency.

When I quickly checked the build files, I noticed that there is an implementation API used everywhere. However, when you build a jar, Gradle adds a runtime scope to all the deps in a generated pom file in this case. To fix that behavior, you can either replace implementation with api for dependencies that must be transitive or write a helper function which will adjust the pom by removing the runtime scope.