Skip to content

Commit

Permalink
feat: Add gen.yaml generation.mockServer configuration (#52)
Browse files Browse the repository at this point in the history
Reference: https://linear.app/speakeasy/issue/SPE-4016/feature-add-mockserver-generation-configuration-flag
Reference: https://linear.app/speakeasy/issue/SPE-4011/feature-enable-mockserver-generation-for-customers

Introduces a new `mockServer` configuration object under the `generation` object that will be used to configure generation settings for the mock server that will be eventually bundled with test generation. While the mock server is under development, the generator will explicitly look for the `MockServer` configuration object to be present and `disabled` to be `false`. When we want to enable mock server generation for customers, we will update that logic to treat missing `MockServer` as "enabled" or if the object is present, respect the `disabled` flag (effectively making it opt-out).
  • Loading branch information
bflad authored Aug 15, 2024
1 parent d4dbb10 commit d9d9303
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ type Generation struct {
Fixes *Fixes `yaml:"fixes,omitempty"`
Auth *Auth `yaml:"auth,omitempty"`

// Mock server generation configuration.
MockServer *MockServer `yaml:"mockServer,omitempty"`

AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility
}

Expand All @@ -72,6 +75,12 @@ type DevContainers struct {
AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility
}

// Generation configuration for the inter-templated mockserver target for test generation.
type MockServer struct {
// Disables the code generation of the mockserver target.
Disabled bool `yaml:"disabled"`
}

type LanguageConfig struct {
Version string `yaml:"version"`
Cfg map[string]any `yaml:",inline"`
Expand Down

0 comments on commit d9d9303

Please sign in to comment.