Class OpenApiCompatibilityChecker
java.lang.Object
com.kingsrook.qqq.middleware.javalin.tools.OpenApiCompatibilityChecker
Structural comparison of two OpenAPI documents (as parsed YAML/JSON maps),
reporting the changes that would break an existing client of the older one.
Breaking (for a client built against OLD):
- a path, or an operation (method) on a path, is removed;
- a response status code of an operation is removed;
- a parameter is removed, changes `in`, or becomes required (or a new
required parameter is added);
- a request body becomes required;
- a component schema is removed;
- in any schema: a property is removed, `type` or `format` changes, `$ref`
changes, an enum value is removed, or a property becomes required.
Not breaking: added paths, operations, optional parameters, properties,
schemas, enum values and response codes; descriptions, summaries, tags and
examples. Adding an enum value to a response can still surprise a strict
client, so clients must treat unknown enum values as "other"
(docs/UI-API-CLIENTS.md).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareSemver(String a, String b) Compare semantic versions: negative, zero or positive as a invalid input: '<' b, a == b, a > b.List the changes from OLD to NEW that would break a client of OLD.static StringgetInfoVersion(Map<String, Object> document) The info.version of a parsed document (or null).static booleanWhether two documents are the same apart from documentation text (descriptions, summaries, examples) and info.Parse an OpenAPI YAML (or JSON) document into a map.
-
Constructor Details
-
OpenApiCompatibilityChecker
public OpenApiCompatibilityChecker()
-
-
Method Details
-
parse
-
getInfoVersion
-
isStructurallyEqual
-
compareSemver
-
findBreakingChanges
-