Skip to content

Commit

Permalink
Add disable required check func to mock gen
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsirbe authored and daveshanley committed May 24, 2024
1 parent c1bba8a commit 3eaa7bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions renderer/mock_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ func (mg *MockGenerator) SetPretty() {
mg.pretty = true
}

// DisableRequiredCheck disables renderer required property check when rendering
// a schema for mocks. This means that all properties will be rendered, not just
// the required ones.
func (mg *MockGenerator) DisableRequiredCheck() {
mg.renderer.DisableRequiredCheck()
}

// GenerateMock generates a mock for a given high-level mockable struct. The mockable struct must contain the following fields:
// Example: any type, this is the default example to use if no examples are present.
// Examples: *orderedmap.Map[string, *base.Example], this is a map of examples keyed by name.
Expand Down

0 comments on commit 3eaa7bf

Please sign in to comment.