mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
Add disable required check func to mock gen
This commit is contained in:
@@ -62,6 +62,13 @@ func (mg *MockGenerator) SetPretty() {
|
|||||||
mg.pretty = true
|
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:
|
// 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.
|
// 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.
|
// Examples: *orderedmap.Map[string, *base.Example], this is a map of examples keyed by name.
|
||||||
|
|||||||
Reference in New Issue
Block a user