openapi: refactor into more generic structure

Refactor the openapi schema to be a more generic structure that can be
"visited" to get more specific types.
This commit is contained in:
Antoine Pelisse
2017-06-14 16:30:57 -07:00
parent 4d2a721223
commit 064f806424
14 changed files with 656 additions and 808 deletions

View File

@@ -27,7 +27,7 @@ import (
var _ = Describe("Getting the Resources", func() {
var client *fakeOpenAPIClient
var expectedData *openapi.Resources
var expectedData openapi.Resources
var instance openapi.Getter
BeforeEach(func() {
@@ -47,12 +47,12 @@ var _ = Describe("Getting the Resources", func() {
result, err := instance.Get()
Expect(err).To(BeNil())
expectEqual(result, expectedData)
Expect(result).To(Equal(expectedData))
Expect(client.calls).To(Equal(1))
result, err = instance.Get()
Expect(err).To(BeNil())
expectEqual(result, expectedData)
Expect(result).To(Equal(expectedData))
// No additional client calls expected
Expect(client.calls).To(Equal(1))
})