OpenAPIComparator

sttp.apispec.openapi.validation.OpenAPIComparator
See theOpenAPIComparator companion object

A utility for comparing two OpenAPI specifications to validate their compatibility.

The OpenAPIComparator class compares the client's OpenAPI specification with the server's specification to detect and highlight compatibility issues. It evaluates various components including paths, operations, parameters, request bodies, responses, headers, schemas, content, and media types.

Note: This comparator does not compare meta-data, such as the info object, server lists, or descriptions in properties.

Value parameters

clientOpenAPI

the OpenAPI specification provided by the client.

serverOpenAPI

the OpenAPI specification provided by the server.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Compares the client and server OpenAPI specifications for compatibility.

Compares the client and server OpenAPI specifications for compatibility.

This method compares the paths in both specifications to identify compatibility issues. It detects incompatibilities such as missing paths, parameter mismatches, schema inconsistencies, and other discrepancies. It organizes the issues into a tree-like structure, with main issues and their sub-issues.

Attributes

Returns

a list of OpenAPICompatibilityIssue instances detailing the identified issues.