Merge branch 'main' into ordered-libopenapi

This commit is contained in:
Tristan Cartledge
2023-12-01 17:57:05 +00:00
14 changed files with 174704 additions and 54215 deletions

View File

@@ -262,6 +262,7 @@ func TestDocument_RenderAndReload_ChangeCheck_Burgershop(t *testing.T) {
// should noth be nil.
assert.Nil(t, errs)
assert.Nil(t, errs)
assert.NotNil(t, rend)
assert.Nil(t, compReport)
}
@@ -291,12 +292,28 @@ func TestDocument_RenderAndReload_ChangeCheck_Stripe(t *testing.T) {
tc := compReport.TotalChanges()
bc := compReport.TotalBreakingChanges()
assert.Equal(t, 0, bc)
assert.Equal(t, 519, tc)
assert.Equal(t, 819, tc)
// there should be no other changes than the 519 descriptions.
assert.Equal(t, 0, len(filtered))
}
func TestDocument_ResolveStripe(t *testing.T) {
bs, _ := os.ReadFile("test_specs/stripe.yaml")
docConfig := datamodel.NewDocumentConfiguration()
docConfig.SkipCircularReferenceCheck = true
docConfig.BasePath = "."
docConfig.AllowRemoteReferences = true
docConfig.AllowFileReferences = true
doc, _ := NewDocumentWithConfiguration(bs, docConfig)
model, _ := doc.BuildV3Model()
rolo := model.Index.GetRolodex()
rolo.Resolve()
assert.Equal(t, 2, len(model.Index.GetRolodex().GetCaughtErrors()))
}
func TestDocument_RenderAndReload_ChangeCheck_Asana(t *testing.T) {
bs, _ := os.ReadFile("test_specs/asana.yaml")
doc, _ := NewDocument(bs)