Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RouterBuilder with OpenAPIContract parameter example does not compile... #2713

Open
InfoSec812 opened this issue Jan 25, 2025 · 0 comments
Open

Comments

@InfoSec812
Copy link
Contributor

The example in the Vert.x docs for using OpenAPIContract with RouterBuilder does not compile. Here's the code I am using:

package com.redhat.consulting._360;

import io.vertx.core.AbstractVerticle;

import io.vertx.core.Future;
import io.vertx.core.Promise;
import io.vertx.ext.web.openapi.RouterBuilder;
import io.vertx.openapi.contract.OpenAPIContract;

import java.util.logging.Logger;

public class MainVerticle extends AbstractVerticle {

  private static Logger LOG = Logger.getLogger(MainVerticle.class.getName());

  @Override
  public void start(Promise<Void> startPromise) throws Exception {
    String pathToContract = "openapi.yaml";

    OpenAPIContract.from(vertx, pathToContract).onSuccess(contract -> {
      RouterBuilder builder = RouterBuilder.create(vertx, contract);
    });
  }
}

And the error I am getting in response:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project 360: Compilation failure
[ERROR] /home/dphillips/Documents/Personal/Workspace/360/src/main/java/com/redhat/consulting/_360/MainVerticle.java:[21,59] incompatible types: io.vertx.openapi.contract.OpenAPIContract cannot be converted to java.lang.String

Looking at the source for 4.5.12, there is no overloaded method which provides the signature demonstrated in the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant