Documentation
¶
Index ¶
- func GetIndex(indexFilePath string) (*azidx.Index, error)
- func GetIndexFromLocalDir(swaggerRepo, indexFilePath string) (*azidx.Index, error)
- func IsPathKeyMatchWithResourceId(pathKey, resourceId string) bool
- func MockResourceIDFromType(azapiResourceType string) (string, string)
- func SchemaNamePathFromRef(swaggerPath string, ref openapiSpec.Ref) (schemaName string, schemaPath string)
- type CoverageItem
- type CoverageReport
- type Model
- type SwaggerModel
- func GetModelInfoFromIndex(resourceId, apiVersion, method, indexFilePath string) (*SwaggerModel, error)
- func GetModelInfoFromIndexRef(ref openapispec.Ref, swaggerRepo string) (*SwaggerModel, error)
- func GetModelInfoFromIndexWithType(azapiResourceType, method, indexCacheFile string) (*SwaggerModel, error)
- func GetModelInfoFromLocalDir(resourceId, swaggerPath string, method string) (*SwaggerModel, error)
- func GetModelInfoFromLocalIndex(resourceId, apiVersion, method, swaggerRepo, indexCacheFile string) (*SwaggerModel, error)
- func GetModelInfoFromLocalSpecFile(resourceId, swaggerPath string, method string) (*SwaggerModel, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIndexFromLocalDir ¶
func IsPathKeyMatchWithResourceId ¶ added in v0.15.0
func MockResourceIDFromType ¶
func SchemaNamePathFromRef ¶
func SchemaNamePathFromRef(swaggerPath string, ref openapiSpec.Ref) (schemaName string, schemaPath string)
Types ¶
type CoverageItem ¶ added in v0.15.0
type CoverageReport ¶
type CoverageReport struct {
Coverages map[string]*CoverageItem
}
func NewOperationPropertiesCoverageReport ¶ added in v0.15.0
func NewOperationPropertiesCoverageReport(traceDir string, swaggerPath string) (*CoverageReport, error)
func (*CoverageReport) AddCoverageFromState ¶
func (c *CoverageReport) AddCoverageFromState(resourceId, resourceType string, jsonBody map[string]interface{}, swaggerPath string) error
func (*CoverageReport) MarkdownContent ¶ added in v0.15.0
func (c *CoverageReport) MarkdownContent() string
func (*CoverageReport) MarkdownContentCompact ¶ added in v0.15.0
func (c *CoverageReport) MarkdownContentCompact() string
type Model ¶
type Model struct {
Bool *map[string]bool `json:"Bool,omitempty"` // key is the Enum value, value is coverage status
BoolCoveredCount int `json:"BoolCoveredCount,omitempty"`
CoveredCount int `json:"CoveredCount,omitempty"`
Discriminator *string `json:"Discriminator,omitempty"`
Enum *map[string]bool `json:"Enum,omitempty"` // key is the Enum value, value is coverage status
EnumCoveredCount int `json:"EnumCoveredCount,omitempty"`
EnumTotalCount int `json:"EnumTotalCount,omitempty"`
Format *string `json:"Format,omitempty"`
HasAdditionalProperties bool `json:"HasAdditionalProperties,omitempty"`
Identifier string `json:"Identifier,omitempty"` // e.g., #.properties.accessPolicies[].permissions.certificates
IsAnyCovered bool `json:"IsAnyCovered"`
IsFullyCovered bool `json:"IsFullyCovered,omitempty"`
IsReadOnly bool `json:"IsReadOnly,omitempty"`
IsRequired bool `json:"IsRequired,omitempty"`
IsRoot bool `json:"IsRoot,omitempty"`
IsSecret bool `json:"IsSecret,omitempty"` // related to x-ms-secret
Item *Model `json:"Item,omitempty"`
ModelName string `json:"ModelName,omitempty"`
Properties *map[string]*Model `json:"Properties,omitempty"`
RootCoveredCount int `json:"RootCoveredCount,omitempty"` // only for root model, covered count plus all variant count if any
RootTotalCount int `json:"RootTotalCount,omitempty"` // only for root model, total count plus all variant count if any
SourceFile string `json:"SourceFile,omitempty"`
TotalCount int `json:"TotalCount,omitempty"`
Type *string `json:"Type,omitempty"`
Variants *map[string]*Model `json:"Variants,omitempty"` // variant model name is used as key, in case x-ms-discriminator-value is not available
VariantType *string `json:"VariantType,omitempty"` // the x-ms-discriminator-value of the variant model if exists, otherwise model name
}
func (*Model) CountCoverage ¶
func (*Model) CredScan ¶
CredScan scans the input payload (root) and extract the secret field and value in the secrets map.
func (*Model) MarkCovered ¶
func (m *Model) MarkCovered(root interface{})
func (*Model) SplitCovered ¶
type SwaggerModel ¶
func GetModelInfoFromIndex ¶
func GetModelInfoFromIndex(resourceId, apiVersion, method, indexFilePath string) (*SwaggerModel, error)
GetModelInfoFromIndex will try to download online index from https://github.com/teowa/azure-rest-api-index-file, and get model info from it if the index is already downloaded as in {indexFilePath}, it will use the cached index
func GetModelInfoFromIndexRef ¶
func GetModelInfoFromIndexRef(ref openapispec.Ref, swaggerRepo string) (*SwaggerModel, error)
func GetModelInfoFromIndexWithType ¶
func GetModelInfoFromIndexWithType(azapiResourceType, method, indexCacheFile string) (*SwaggerModel, error)
func GetModelInfoFromLocalDir ¶
func GetModelInfoFromLocalDir(resourceId, swaggerPath string, method string) (*SwaggerModel, error)
func GetModelInfoFromLocalIndex ¶
func GetModelInfoFromLocalIndex(resourceId, apiVersion, method, swaggerRepo, indexCacheFile string) (*SwaggerModel, error)
GetModelInfoFromLocalIndex tries to build index from local swagger repo and get model info from it
func GetModelInfoFromLocalSpecFile ¶
func GetModelInfoFromLocalSpecFile(resourceId, swaggerPath string, method string) (*SwaggerModel, error)
Click to show internal directories.
Click to hide internal directories.