From 938a4a101b028f20bcfc6ff52eace775986ea7ff Mon Sep 17 00:00:00 2001 From: Tristan Cartledge Date: Mon, 11 Nov 2024 15:43:07 +1000 Subject: [PATCH] feat: add ability to disable automatic test generation --- configuration.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configuration.go b/configuration.go index 31322f8..c6f96e7 100644 --- a/configuration.go +++ b/configuration.go @@ -53,6 +53,10 @@ type Auth struct { OAuth2PasswordEnabled bool `yaml:"oAuth2PasswordEnabled"` } +type Tests struct { + GenerateNewTests bool `yaml:"generateNewTests"` +} + type Generation struct { DevContainers *DevContainers `yaml:"devContainers,omitempty"` BaseServerURL string `yaml:"baseServerUrl,omitempty"` @@ -66,6 +70,8 @@ type Generation struct { // Mock server generation configuration. MockServer *MockServer `yaml:"mockServer,omitempty"` + Tests Tests `yaml:"tests,omitempty"` + AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility } @@ -347,6 +353,12 @@ func GetGenerationDefaults(newSDK bool) []SDKGenConfigField { DefaultValue: ptr(newSDK), Description: pointer.To("Enables support for OAuth2 resource owner password credentials grant type (Enterprise tier only)"), }, + { + Name: "tests.generateNewTests", + Required: false, + DefaultValue: ptr(false), + Description: pointer.To("Enables generation of new tests for any new operations found in the OpenAPI spec"), + }, } }