Skip to content

Conversation

holm0563
Copy link

See change log and #69

@holm0563 holm0563 marked this pull request as ready for review June 17, 2025 16:15
@holm0563
Copy link
Author

1.0

  • Made breaking changes to support that additive changes are allowed by default
  • Compare now returns a Change level that reflects the result or all found changes.
  • Removed strict mode.
    • When not in strict mode there were very few errors in previous versions
    • A major version update in the spec is now considered an Breaking rule in that your API can intentionally change.
  • Combined the Parsing Errors with the Comparsion Messages
  • On the message itself a code will now always uniquely identify the message severity
    • Severity now includes a Breaking severity
  • Split up several Code so that they are easier to identify and customize
    • ConstrantIsStronger
      • ResponseConstraintIsStronger
      • EnumConstrantIsStronger
    • AddedPropertyInResponse
      • AddedBreakingPropertyInResponse
    • ConstraintChanged
      • EnumConstraintChanged
      • MultipleOfConstraintChanged
      • UniqueItemsConstraintChanged
    • Added new Codes
      • MajorVersionChange
      • MinorVersionChange
      • NonSemanticVersion
  • Removed .NET 6 support as its no longer supported by Microsoft

@holm0563
Copy link
Author

Here is an example of how to use the Comparator with custom rules:

var result = OpenApiComparator.Compare(
    out var differences,
    oldOpenApiSpec,
    newOpenApiSpec
);

// Ignore codes
differences.RemoveAll(s => s.Code is "VersionsReversed" or "NoVersionChange");
// Change severity
differences.Where(s => s.Mode == MessageType.Addition).ToList()
                .ForEach(s => s.Severity = MessageSeverity.Info);
// Calculate new result based on remaining rules
var newResult = OpenApiComparator.GetLevel(differences);

Previously strict mode concept made this difficult to do and predict the results.

@holm0563 holm0563 mentioned this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant