Class OpenAPIComparator
java.lang.Object
org.brapi.schematools.core.openapi.comparator.OpenAPIComparator
Compares two OpenAPI Specifications
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a Comparator with default options -
Method Summary
Modifier and TypeMethodDescriptionResponse<org.openapitools.openapidiff.core.model.ChangedOpenApi> Compares the OpenAPI Specification in a string on a file path and outputs the result in the provided format and returns a diff object for downstream use.compare(String firstContent, String secondContent, Path outputPath, ComparisonOutputFormat outputFormat) Compares the OpenAPI Specification in files on a file path and a diff object for downstream use.Response<org.openapitools.openapidiff.core.model.ChangedOpenApi> Compares the OpenAPI Specification in files on a file path and returns a diff object for downstream use.compare(Path firstPath, Path secondPath, Path outputPath, ComparisonOutputFormat outputFormat) Compares the OpenAPI Specification in files on a file path and outputs the result in the provided format.
-
Constructor Details
-
OpenAPIComparator
public OpenAPIComparator()Creates a Comparator with default options -
OpenAPIComparator
-
-
Method Details
-
compare
public Response<org.openapitools.openapidiff.core.model.ChangedOpenApi> compare(Path firstPath, Path secondPath) Compares the OpenAPI Specification in files on a file path and returns a diff object for downstream use.- Parameters:
firstPath- the path of the first SpecificationsecondPath- the path of the second Specification- Returns:
- a response with the diff output
-
compare
public Response<Path> compare(Path firstPath, Path secondPath, Path outputPath, ComparisonOutputFormat outputFormat) Compares the OpenAPI Specification in files on a file path and outputs the result in the provided format. If the output file does not exist, it will be created along with any missing parent directories.- Parameters:
firstPath- the path of the first SpecificationsecondPath- the path of the second SpecificationoutputPath- the path of output file.outputFormat- the format of the output- Returns:
- a response with the path of the created output
-
compare
public Response<org.openapitools.openapidiff.core.model.ChangedOpenApi> compare(String firstContent, String secondContent) Compares the OpenAPI Specification in a string on a file path and outputs the result in the provided format and returns a diff object for downstream use.- Parameters:
firstContent- the content of the first SpecificationsecondContent- the content of the second Specification- Returns:
- a response with the diff output
-
compare
public Response<Path> compare(String firstContent, String secondContent, Path outputPath, ComparisonOutputFormat outputFormat) Compares the OpenAPI Specification in files on a file path and a diff object for downstream use.- Parameters:
firstContent- the content of the first SpecificationsecondContent- the content of the second SpecificationoutputPath- the path of output file.outputFormat- the format of the output- Returns:
- a response with the path of the created output
-