Documentation
¶
Overview ¶
Package filter is a generated GoMock package.
Index ¶
- func ApplyFilters(doc *openapi3.T, metadata *Metadata, ...) (*openapi3.T, error)
- func MergeFilteredSpecs(specs []*openapi3.T) (*openapi3.T, error)
- type BumpFilter
- type CodeSampleFilter
- type ExtensionFilter
- type Filter
- type HiddenEnvsFilter
- type InfoVersioningFilter
- type Metadata
- type MockFilter
- type MockFilterMockRecorder
- type OperationConfig
- type OperationsFilter
- type ParametersFilter
- type ResponseFilter
- type SchemasFilter
- type State
- type SunsetFilter
- type TagsFilter
- type VersionConfig
- type VersioningExtensionFilter
- type VersioningFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFilters ¶
Types ¶
type BumpFilter ¶
type BumpFilter struct {
// contains filtered or unexported fields
}
BumpFilter modifies includes the fields "x-state" and "x-beta" to the "preview" and "upcoming" APIs Operations. The "x-state" and "x-beta" fields are bump.sh custom fields to include budges Bump.sh feature: https://docs.bump.sh/help/specification-support/doc-badges/
func (*BumpFilter) Apply ¶
func (f *BumpFilter) Apply() error
func (*BumpFilter) ValidateMetadata ¶
func (f *BumpFilter) ValidateMetadata() error
type CodeSampleFilter ¶
type CodeSampleFilter struct {
// contains filtered or unexported fields
}
CodeSampleFilter modifies includes the fields "x-state" and "x-beta" to the "preview" and "upcoming" APIs Operations. The "x-state" and "x-beta" fields are bump.sh custom fields to include budges Bump.sh feature: https://docs.bump.sh/help/specification-support/doc-code-samples/#example-usage
func (*CodeSampleFilter) Apply ¶
func (f *CodeSampleFilter) Apply() error
func (*CodeSampleFilter) ValidateMetadata ¶
func (f *CodeSampleFilter) ValidateMetadata() error
type ExtensionFilter ¶
type ExtensionFilter struct {
// contains filtered or unexported fields
}
ExtensionFilter is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec. If metadata.keepIPAExceptions is true, the x-xgen-IPA-exception extensions are kept.
func (*ExtensionFilter) Apply ¶
func (f *ExtensionFilter) Apply() error
func (*ExtensionFilter) ValidateMetadata ¶
func (f *ExtensionFilter) ValidateMetadata() error
type Filter ¶
func FiltersToCleanupRefs ¶
func FiltersToGetVersions ¶
FiltersToGetVersions returns a list of filters to apply to the OpenAPI document to get the versions.
type HiddenEnvsFilter ¶
type HiddenEnvsFilter struct {
// contains filtered or unexported fields
}
HiddenEnvsFilter removes paths, operations, request/response bodies and content types that are hidden for the target environment.
func (*HiddenEnvsFilter) Apply ¶
func (f *HiddenEnvsFilter) Apply() error
func (*HiddenEnvsFilter) ValidateMetadata ¶
func (f *HiddenEnvsFilter) ValidateMetadata() error
type InfoVersioningFilter ¶
type InfoVersioningFilter struct {
// contains filtered or unexported fields
}
InfoVersioningFilter modifies the Info object in the OpenAPI spec with the target version.
func (*InfoVersioningFilter) Apply ¶
func (f *InfoVersioningFilter) Apply() error
func (*InfoVersioningFilter) ValidateMetadata ¶
func (f *InfoVersioningFilter) ValidateMetadata() error
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
func NewMetadata ¶
func NewMetadata(targetVersion *apiversion.APIVersion, targetEnv string) *Metadata
func NewMetadataWithIPAExceptions ¶
func NewMetadataWithIPAExceptions(targetVersion *apiversion.APIVersion, targetEnv string, keepIPAExceptions bool) *Metadata
type MockFilter ¶
type MockFilter struct {
// contains filtered or unexported fields
}
MockFilter is a mock of Filter interface.
func NewMockFilter ¶
func NewMockFilter(ctrl *gomock.Controller) *MockFilter
NewMockFilter creates a new mock instance.
func (*MockFilter) EXPECT ¶
func (m *MockFilter) EXPECT() *MockFilterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockFilterMockRecorder ¶
type MockFilterMockRecorder struct {
// contains filtered or unexported fields
}
MockFilterMockRecorder is the mock recorder for MockFilter.
func (*MockFilterMockRecorder) Apply ¶
func (mr *MockFilterMockRecorder) Apply() *gomock.Call
Apply indicates an expected call of Apply.
type OperationConfig ¶
type OperationConfig struct {
// contains filtered or unexported fields
}
OperationConfig contains the information needed while parsing an operation of the OAS.
type OperationsFilter ¶
type OperationsFilter struct {
// contains filtered or unexported fields
}
OperationsFilter is a filter that removes the x-xgen-owner-team extension from operations.
func (*OperationsFilter) Apply ¶
func (f *OperationsFilter) Apply() error
func (*OperationsFilter) ValidateMetadata ¶
func (*OperationsFilter) ValidateMetadata() error
type ParametersFilter ¶
type ParametersFilter struct {
// contains filtered or unexported fields
}
func (*ParametersFilter) Apply ¶
func (f *ParametersFilter) Apply() error
func (*ParametersFilter) ValidateMetadata ¶
func (*ParametersFilter) ValidateMetadata() error
type ResponseFilter ¶
type ResponseFilter struct {
// contains filtered or unexported fields
}
func (*ResponseFilter) Apply ¶
func (f *ResponseFilter) Apply() error
func (*ResponseFilter) ValidateMetadata ¶
func (*ResponseFilter) ValidateMetadata() error
type SchemasFilter ¶
type SchemasFilter struct {
// contains filtered or unexported fields
}
SchemasFilter removes unused #/components/schemas/.
func (*SchemasFilter) Apply ¶
func (f *SchemasFilter) Apply() error
Apply removes all unused schemas from the OpenAPI specification. A schema is considered used if it is referenced directly outside of #/components/schemas or transitively through other used schemas.
func (*SchemasFilter) ValidateMetadata ¶
func (*SchemasFilter) ValidateMetadata() error
type SunsetFilter ¶
type SunsetFilter struct {
// contains filtered or unexported fields
}
SunsetFilter removes the sunsetToBeDecided from the openapi specification.
func (*SunsetFilter) Apply ¶
func (f *SunsetFilter) Apply() error
func (*SunsetFilter) ValidateMetadata ¶
func (*SunsetFilter) ValidateMetadata() error
type TagsFilter ¶
type TagsFilter struct {
// contains filtered or unexported fields
}
TagsFilter removes tags that are not used in the operations.
func (*TagsFilter) Apply ¶
func (f *TagsFilter) Apply() error
func (*TagsFilter) ValidateMetadata ¶
func (*TagsFilter) ValidateMetadata() error
type VersionConfig ¶
type VersionConfig struct {
// contains filtered or unexported fields
}
VersionConfig contains the information needed during the versioning filtering of the OAS. It contains the parsed operations, the operations that need to be removed and the version under scrutiny.
type VersioningExtensionFilter ¶
type VersioningExtensionFilter struct {
// contains filtered or unexported fields
}
VersioningExtensionFilter is a filter that updates the x-sunset and x-xgen-version extensions to a date string and deletes the x-sunset extension if the latest matched version is deprecated by hidden versions for the target environment.
func (*VersioningExtensionFilter) Apply ¶
func (f *VersioningExtensionFilter) Apply() error
func (*VersioningExtensionFilter) ValidateMetadata ¶
func (f *VersioningExtensionFilter) ValidateMetadata() error
type VersioningFilter ¶
type VersioningFilter struct {
// contains filtered or unexported fields
}
VersioningFilter is a filter that modifies the OpenAPI spec by removing paths, operations and responses that are not supported by the target version.
func (*VersioningFilter) Apply ¶
func (f *VersioningFilter) Apply() error
func (*VersioningFilter) ValidateMetadata ¶
func (f *VersioningFilter) ValidateMetadata() error