Skip to content

Commit

Permalink
Add error property to specStubResource so getResourceSchema() can ret…
Browse files Browse the repository at this point in the history
…urn an error
  • Loading branch information
lillchan committed Sep 14, 2019
1 parent 1ad586d commit 07534ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openapi/openapi_stub_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type specStubResource struct {
fullParentResourceName string

funcGetResourcePath func(parentIDs []string) (string, error)

error error
}

func newSpecStubResource(name, path string, shouldIgnore bool, schemaDefinition *specSchemaDefinition) *specStubResource {
Expand Down Expand Up @@ -48,6 +50,9 @@ func (s *specStubResource) getResourcePath(parentIDs []string) (string, error) {
}

func (s *specStubResource) getResourceSchema() (*specSchemaDefinition, error) {
if s.error != nil {
return nil, s.error
}
return s.schemaDefinition, nil
}

Expand Down

0 comments on commit 07534ed

Please sign in to comment.