DBZ-4460 Renaming all openapi occurrences to schema

This commit is contained in:
Anisha Mohanty 2022-01-06 19:47:02 +05:30 committed by Gunnar Morling
parent 3d1988cf6f
commit d6c5ad2e7c
7 changed files with 17 additions and 17 deletions

View File

@ -225,7 +225,7 @@
<execution>
<id>generate-connector-metadata</id>
<goals>
<goal>generate-openapi-spec</goal>
<goal>generate-api-spec</goal>
</goals>
<phase>prepare-package</phase>
</execution>

View File

@ -432,7 +432,7 @@
<execution>
<id>generate-connector-metadata</id>
<goals>
<goal>generate-openapi-spec</goal>
<goal>generate-api-spec</goal>
</goals>
<phase>prepare-package</phase>
</execution>

View File

@ -207,7 +207,7 @@
<execution>
<id>generate-connector-metadata</id>
<goals>
<goal>generate-openapi-spec</goal>
<goal>generate-api-spec</goal>
</goals>
<phase>prepare-package</phase>
</execution>

View File

@ -250,7 +250,7 @@
<execution>
<id>generate-connector-metadata</id>
<goals>
<goal>generate-openapi-spec</goal>
<goal>generate-api-spec</goal>
</goals>
<phase>prepare-package</phase>
</execution>

View File

@ -197,7 +197,7 @@
<execution>
<id>generate-connector-metadata</id>
<goals>
<goal>generate-openapi-spec</goal>
<goal>generate-api-spec</goal>
</goals>
<phase>prepare-package</phase>
</execution>

View File

@ -24,17 +24,17 @@
import io.debezium.schemagenerator.formats.ApiFormat;
import io.debezium.schemagenerator.formats.ApiFormatName;
public class OpenApiGenerator {
public class SchemaGenerator {
public static void main(String[] args) {
if (args.length != 2) {
throw new IllegalArgumentException("Usage: OpenApiGenerator <format-name> <output-directory>");
throw new IllegalArgumentException("Usage: SchemaGenerator <format-name> <output-directory>");
}
String formatName = args[0].trim();
Path outputDirectory = new File(args[1]).toPath();
new OpenApiGenerator().run(formatName, outputDirectory);
new SchemaGenerator().run(formatName, outputDirectory);
}
private void run(String formatName, Path outputDirectory) {

View File

@ -33,16 +33,16 @@
import com.google.common.base.Charsets;
import io.debezium.DebeziumException;
import io.debezium.schemagenerator.OpenApiGenerator;
import io.debezium.schemagenerator.SchemaGenerator;
import io.smallrye.openapi.runtime.io.Format;
/**
* Generates the OpenAPI spec for the connector(s) in a project.
* Generates the API spec for the connector(s) in a project.
*/
@Mojo(name = "generate-openapi-spec", defaultPhase = LifecyclePhase.PREPARE_PACKAGE)
public class OpenApiGeneratorMojo extends AbstractMojo {
@Mojo(name = "generate-api-spec", defaultPhase = LifecyclePhase.PREPARE_PACKAGE)
public class SchemaGeneratorMojo extends AbstractMojo {
@Parameter(defaultValue = "openapi", property = "openapi.generator.format")
@Parameter(defaultValue = "openapi", property = "schema.format")
private String format;
@Parameter(defaultValue = "${project.build.directory}/generated-sources", required = true)
@ -59,15 +59,15 @@ public void execute() throws MojoExecutionException, MojoFailureException {
String classPath = getClassPath();
try {
int result = exec(OpenApiGenerator.class.getName(), classPath, Collections.emptyList(), Arrays.<String> asList(format, outputDirectory.getAbsolutePath()));
int result = exec(SchemaGenerator.class.getName(), classPath, Collections.emptyList(), Arrays.<String> asList(format, outputDirectory.getAbsolutePath()));
if (result != 0) {
throw new MojoExecutionException("Couldn't generate OpenAPI spec; please see the logs for more details");
throw new MojoExecutionException("Couldn't generate API spec; please see the logs for more details");
}
getLog().info("Generated OpenAPI spec at " + outputDirectory.getAbsolutePath());
getLog().info("Generated API spec at " + outputDirectory.getAbsolutePath());
}
catch (IOException | InterruptedException e) {
throw new MojoExecutionException("Couldn't generate OpenAPI spec", e);
throw new MojoExecutionException("Couldn't generate API spec", e);
}
}