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

what changed does not detect custom extension change #348

Open
LasneF opened this issue Nov 7, 2024 · 0 comments
Open

what changed does not detect custom extension change #348

LasneF opened this issue Nov 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@LasneF
Copy link
Contributor

LasneF commented Nov 7, 2024

custom extension are supported for the license
https://spec.openapis.org/oas/latest.html#fixed-fields-2

given 2 spec with same license except that custom extension are not the same

they are seen as 100 % similar in the test case

func TestCompareLicense_Identicalz(t *testing.T) {

	left := `name: buckaroo
url: https://pb33f.io
x-myXtend : 324`

	right := `name: buckaroo
url: https://pb33f.io
x-myXtend : 325`

	var lNode, rNode yaml.Node
	_ = yaml.Unmarshal([]byte(left), &lNode)
	_ = yaml.Unmarshal([]byte(right), &rNode)

	// create low level objects
	var lDoc lowbase.License
	var rDoc lowbase.License
	_ = low.BuildModel(lNode.Content[0], &lDoc)
	_ = low.BuildModel(rNode.Content[0], &rDoc)
	_ = lDoc.Build(context.Background(), nil, lNode.Content[0], nil)
	_ = rDoc.Build(context.Background(), nil, rNode.Content[0], nil)

	// compare.
	extChanges := CompareLicense(&lDoc, &rDoc)
	assert.Nil(t, extChanges)
}
@daveshanley daveshanley added the bug Something isn't working label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants