mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 20:47:49 +00:00
We-worked model to remove resolver.
lookups are performed inline now. keeps things simpler, however it has a performance knock, so it's time to refine async building were possible.
This commit is contained in:
@@ -24,6 +24,17 @@ func BenchmarkCreateDocument(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkCreateDocument_Stripe(b *testing.B) {
|
||||
data, _ := ioutil.ReadFile("../test_specs/stripe.yaml")
|
||||
info, _ := datamodel.ExtractSpecInfo(data)
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := CreateDocument(info)
|
||||
if err != nil {
|
||||
panic("this should not error")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateDocument(t *testing.T) {
|
||||
assert.Equal(t, "3.0.1", doc.Version.Value)
|
||||
assert.Equal(t, "Burger Shop", doc.Info.Value.Title.Value)
|
||||
@@ -254,8 +265,9 @@ func TestCreateDocument_Components_Schemas(t *testing.T) {
|
||||
assert.NotNil(t, fries.Value)
|
||||
|
||||
assert.Len(t, fries.Value.Properties.Value, 3)
|
||||
p := fries.Value.FindProperty("favoriteDrink")
|
||||
assert.Equal(t, "a frosty cold beverage can be coke or sprite",
|
||||
fries.Value.FindProperty("favoriteDrink").Value.Description.Value)
|
||||
p.Value.Description.Value)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user