Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix enum comparison by looking on the definitive value (without style) #364

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

LasneF
Copy link
Contributor

@LasneF LasneF commented Jan 15, 2025

Fix this issue
pb33f/openapi-changes#135

@LasneF
Copy link
Contributor Author

LasneF commented Jan 15, 2025

Notice this is just for enum

there is also something there

but also there

\github\libopenapi\what-changed\model\comparison_functions.go
func CheckForModification[T any](l, r *yaml.Node, label string, changes *[]*Change, breaking bool, orig, new T) {
if l != nil && l.Value != "" && r != nil && r.Value != "" && (r.Value != l.Value || r.Tag != l.Tag) {

isssue is that on a yaml
toto : "a"
toto : a

image

has same Value but not same tag ( one is !!int , the other is !!str)
and so it spot a diff breaking as of today , to me the tooling is about semantic diff not yaml diff, or space diff

Copy link
Member

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! thank. you.

@daveshanley daveshanley merged commit baf52c9 into pb33f:main Jan 22, 2025
2 checks passed
@LasneF LasneF deleted the fixEnumDiff branch January 22, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants