Documentation ¶
Index ¶
- Constants
- Variables
- func AdditionalPropertiesAllowed(aprops oas3.AdditionalProperties) bool
- func AdditionalPropertiesExists(props oas3.AdditionalProperties) bool
- func BuildApiURLOAS(specServerURL, overrideServerURL, specPath string) string
- func ContentToSchemaRefMap(content oas3.Content) map[string]string
- func CopySchemaStandard(schema oas3.Schema) (oas3.Schema, error)
- func GetExtensionPropString(xprops map[string]any, key string) (string, error)
- func GetExtensionPropStringOrEmpty(xprops map[string]any, key string) string
- func OpTableColumnsDefault(inclDocsURL bool) *tabulator.ColumnSet
- func OpTableColumnsRingCentral() *tabulator.ColumnSet
- func ParsePathParametersParens(urlPath string) []string
- func PathItemHasEndpoints(pathItem *oas3.PathItem) bool
- func PathMatchGeneric(path1, path2 string) bool
- func PathMethods(pathItem *oas3.PathItem) []string
- func PathParams(p string) []string
- func PathVarsToGeneric(input string) string
- func ReadSchemaFile(filename string) (*oas3.Schema, error)
- func SchemaPointerExpand(prefix, schemaName string) string
- func SecurityRequirementsToRaw(secReqs oas3.SecurityRequirements) []map[string][]string
- func VisitOperations(spec *Spec, visitOp func(path, method string, op *oas3.Operation))
- func VisitOperationsPathItem(path string, pathItem *oas3.PathItem, ...)
- func VisitTypesFormats(spec *Spec, visitTypeFormat func(jsonPointerRoot, oasType, oasFormat string))
- func WriteFileDirMerge(outfile, inputDir string, perm os.FileMode, mergeOpts *MergeOptions) (int, error)
- type CollisionCheckResult
- type ExtensionPropsParent
- type IntersectionData
- type JSONPointer
- type MergeOptions
- type Ontology
- type OntologySet
- type Operation
- type OperationMeta
- type OperationMetas
- type OperationMore
- func (om *OperationMore) ExtensionPropStringOrEmpty(key string) string
- func (om *OperationMore) HasParameter(paramNameWant string) bool
- func (om *OperationMore) JSONPointers() map[string][]string
- func (om *OperationMore) Meta() *OperationMeta
- func (om *OperationMore) PathMethod() string
- func (om *OperationMore) RequestBodySchemaRef() []string
- func (om *OperationMore) RequestMediaTypes(spec *Spec) ([]string, error)
- func (om *OperationMore) ResponseMediaTypes() []string
- func (om *OperationMore) SecurityScopes(fullyQualified bool) []string
- type OperationMoreStringFunc
- type OperationMoreStringFuncMap
- type OperationMores
- type ParameterNames
- type PathItemMore
- type Spec
- func Merge(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
- func MergeDirectory(dir string, mergeOpts *MergeOptions) (*Spec, int, error)
- func MergeFiles(filepaths []string, mergeOpts *MergeOptions) (*Spec, error)
- func MergeParameters(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
- func MergePaths(specMaster, specExtra *Spec) (*Spec, error)
- func MergeRequestBodies(specMaster, specExtra *Spec, specExtraNote string) (*Spec, error)
- func MergeResponses(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
- func MergeSchemas(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
- func MergeTags(specMaster, specExtra *Spec) *Spec
- func MergeWithTables(spec1, spec2 *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, []*table.Table, error)
- func NewSpec(oasVersion, apiTitle, apiVersion string) *Spec
- func Parse(oas3Bytes []byte) (*Spec, error)
- func ReadFile(oas3file string, validate bool) (*Spec, error)
- func ReadURL(oas3url string) (*Spec, error)
- type SpecMeta
- type SpecMetadata
- type SpecMetas
- type SpecMore
- func (sm *SpecMore) Clone() (*Spec, error)
- func (sm *SpecMore) ComponentRequestBody(componentPath string) *oas3.RequestBodyRef
- func (sm *SpecMore) ExportByTag(tag string) (*Spec, error)
- func (sm *SpecMore) ExportByTags() (map[string]*Spec, error)
- func (sm *SpecMore) ExtensionNames() map[string]int
- func (sm *SpecMore) HasComponentSchema(componentSchemaName string, caseInsensitiveCaseMatch bool) bool
- func (sm *SpecMore) MarshalJSON(prefix, indent string) ([]byte, error)
- func (sm *SpecMore) MarshalYAML() ([]byte, error)
- func (sm *SpecMore) Metadata() SpecMetadata
- func (sm *SpecMore) Ontology() Ontology
- func (sm *SpecMore) OperationByID(wantOperationID string) (path, method string, op *oas3.Operation, err error)
- func (sm *SpecMore) OperationByPathMethod(path, method string) (*oas3.Operation, error)
- func (sm *SpecMore) OperationCountsByTag() *histogram.Histogram
- func (sm *SpecMore) OperationIDs() []string
- func (sm *SpecMore) OperationIDsCounts() map[string]int
- func (sm *SpecMore) OperationIDsLocations() map[string][]string
- func (sm *SpecMore) OperationMetas(inclTags []string) []OperationMeta
- func (sm *SpecMore) OperationMetasMap(inclTags []string) map[string]OperationMeta
- func (sm *SpecMore) OperationParametersDescriptionStatus() maputil.MapStringMapStringInt
- func (sm *SpecMore) OperationParametersDescriptionStatusCounts() (with, without, all int)
- func (sm *SpecMore) OperationParametersWithoutDescriptionsWriteFile(filename string) error
- func (sm *SpecMore) Operations(inclTags []string) *OperationMores
- func (sm *SpecMore) OperationsCount() int
- func (sm *SpecMore) OperationsDescriptionInfo() map[string][]string
- func (sm *SpecMore) OperationsTable(columns *tabulator.ColumnSet, ...) (*table.Table, error)
- func (sm *SpecMore) ParamPathNamesComponents() map[string][]string
- func (sm *SpecMore) ParamPathNamesOperations() map[string][]string
- func (sm *SpecMore) ParamPathNamesPaths() map[string][]string
- func (sm *SpecMore) ParameterNames() map[string][]string
- func (sm *SpecMore) ParameterPathNames() ParameterNames
- func (sm *SpecMore) PathMethods(generic bool) []string
- func (sm *SpecMore) PrintJSON(prefix, indent string) error
- func (sm *SpecMore) RequestBodyRef(componentKeyOrPointer string) (*oas3.RequestBodyRef, error)
- func (sm *SpecMore) RequestBodyRefMediaTypes(ref *oas3.RequestBodyRef) ([]string, error)
- func (sm *SpecMore) SchemaNameExists(schemaName string, includeNil bool) bool
- func (sm *SpecMore) SchemaNames() []string
- func (sm *SpecMore) SchemaNamesStatus() (schemaNoReference, both, referenceNoSchema []string, err error)
- func (sm *SpecMore) SchemaPointers(dedupe bool) ([]string, []string, error)
- func (sm *SpecMore) SchemaPropertiesDescriptionStatus() maputil.MapStringMapStringInt
- func (sm *SpecMore) SchemaPropertiesDescriptionStatusCounts() (with, without, all int)
- func (sm *SpecMore) SchemaPropertiesWithoutDescriptionsWriteFile(filename string) error
- func (sm *SpecMore) SchemaRef(schemaName string) *oas3.SchemaRef
- func (sm *SpecMore) SchemaRefSet(schemaName string, schemaRef *oas3.SchemaRef) error
- func (sm *SpecMore) SchemasCopyJSONPointer(destSpec *Spec, jsonPointer string) error
- func (sm *SpecMore) SchemasCopyOperation(destSpec *Spec, op *oas3.Operation) error
- func (sm *SpecMore) SchemasCopySchemaRef(destSpec *Spec, schRef *oas3.SchemaRef) error
- func (sm *SpecMore) SchemasCount() int
- func (sm *SpecMore) ServerURL(index uint) string
- func (sm *SpecMore) ServerURLBasePath(index uint) (string, error)
- func (sm *SpecMore) SetOperation(path, method string, op *oas3.Operation)
- func (sm *SpecMore) SpecTagStats() SpecTagStats
- func (sm *SpecMore) Stats() SpecStats
- func (sm *SpecMore) StatusCodesHistogram() *histogram.HistogramSets
- func (sm *SpecMore) Tags(opts *TagsOpts) []string
- func (sm *SpecMore) TagsMap(opts *TagsOpts) map[string]int
- func (sm *SpecMore) TagsValidate() bool
- func (sm *SpecMore) Validate() error
- func (sm *SpecMore) ValidateMore() (ValidationStatus, error)
- func (sm *SpecMore) WriteFileCSV(filename string, addlColFuncs *OperationMoreStringFuncMap) error
- func (sm *SpecMore) WriteFileJSON(filename string, perm os.FileMode, prefix, indent string) error
- func (sm *SpecMore) WriteFileXLSX(filename string, columns *tabulator.ColumnSet, ...) error
- func (sm *SpecMore) WriteFileXLSXOperationStatusCodes(filename string) error
- func (sm *SpecMore) WriteFileYAML(filename string, perm os.FileMode) error
- type SpecStats
- type SpecTagCounts
- type SpecTagStats
- type TagsMore
- type TagsOpts
- type ValidationStatus
Constants ¶
const ( OASVersionLatest = "3.1.0" OASVersionDefault = "3.0.3" TypeArray = "array" TypeBoolean = "boolean" TypeInteger = "integer" TypeObject = "object" TypeString = "string" FormatDate = "date" FormatDateTime = "date-time" FormatInt32 = "int32" FormatInt64 = "int64" PropertyOperationID = "operationId" PropertySummary = "summary" PropertyTags = "tags" InCookie = "cookie" InHeader = "header" InPath = "path" InQuery = "query" PointerComponentsRequestBodies = "#/components/requestBodies" PointerComponentsSchemas = "#/components/schemas" PointerComponentsSchemasFormat = `#/components/schemas/%s` )
const ( DescStatusIsEmpty = 0 DescStatusIsNotEmpty = 1 DescStatusDefaultSep = " ~~~ " )
const ( XTagGroups = "x-tag-groups" XThrottlingGroup = "x-throttling-group" )
const ( PathComponents = "components" PathParameters = "parameters" PathPath = "path" PathSchemas = "schemas" PathComponentsParameters = "#/components/parameters" )
const ( LocationParameter = "parameter" LocationRequest = "request" LocationResponse = "response" )
Variables ¶
var ( ErrPathNotFound = errors.New("path not found") ErrOperationNotFound = errors.New("operation not found") )
var ErrJSONPointerNotParamOrSchema = errors.New("pointer is not components/parameters or components/schemas")
var ErrOperationNotSet = errors.New("operation not set")
var ErrSpecNotSet = errors.New("spec not set")
var RxPathParam = regexp.MustCompile(`\{([^\{\}]+)\}`)
Functions ¶
func AdditionalPropertiesAllowed ¶ added in v1.16.7
func AdditionalPropertiesAllowed(aprops oas3.AdditionalProperties) bool
AdditionalPropertiesAllowed checks for additional properties, which exists in Schema structs.
func AdditionalPropertiesExists ¶ added in v1.16.7
func AdditionalPropertiesExists(props oas3.AdditionalProperties) bool
func BuildApiURLOAS ¶ added in v1.12.0
func ContentToSchemaRefMap ¶ added in v1.14.0
func GetExtensionPropString ¶
GetExtensionPropString converts extension prop value from `json.RawMessage` to `string`.
func GetExtensionPropStringOrEmpty ¶
GetExtensionPropStringOrEmpty converts extension prop value from `json.RawMessage` to `string`.
func OpTableColumnsDefault ¶
func ParsePathParametersParens ¶ added in v1.16.0
func PathItemHasEndpoints ¶ added in v1.16.0
func PathMatchGeneric ¶ added in v1.16.0
func PathMethods ¶ added in v1.16.0
func PathParams ¶ added in v1.16.0
func PathVarsToGeneric ¶ added in v1.16.0
func SchemaPointerExpand ¶
func SecurityRequirementsToRaw ¶
func SecurityRequirementsToRaw(secReqs oas3.SecurityRequirements) []map[string][]string
SecurityRequirementsToRaw returns a raw SecurityRequirements slice to be used for iterating over elements.
func VisitOperations ¶
func VisitOperationsPathItem ¶ added in v1.8.2
func VisitTypesFormats ¶
func WriteFileDirMerge ¶
Types ¶
type CollisionCheckResult ¶
type CollisionCheckResult int
const ( CollisionCheckSame CollisionCheckResult = iota CollisionCheckOverwrite CollisionCheckError CollisionCheckSkip )
func SchemaCheckCollisionDefault ¶
func SchemaCheckCollisionDefault(schemaName string, item1, item2 interface{}, item2Note string) CollisionCheckResult
func SchemaCheckCollisionSkip ¶
func SchemaCheckCollisionSkip(schemaName string, item1, item2 interface{}, item2Note string) CollisionCheckResult
type ExtensionPropsParent ¶
type ExtensionPropsParent interface{}
type IntersectionData ¶ added in v1.16.0
type IntersectionData struct { Spec1 SpecMetadata Spec2 SpecMetadata Intersection SpecMetadata }
func NewIntersectionData ¶ added in v1.16.0
func NewIntersectionData() IntersectionData
func SpecsIntersection ¶ added in v1.16.0
func SpecsIntersection(spec1, spec2 *Spec) IntersectionData
func (*IntersectionData) Sort ¶ added in v1.16.0
func (idata *IntersectionData) Sort()
type JSONPointer ¶ added in v1.14.0
type JSONPointer jsonpointer.JSONPointer
func ParseJSONPointer ¶ added in v1.14.0
func ParseJSONPointer(s string) (JSONPointer, error)
func (*JSONPointer) IsTopParameter ¶ added in v1.14.0
func (p *JSONPointer) IsTopParameter() (string, bool)
func (*JSONPointer) IsTopSchema ¶ added in v1.14.0
func (p *JSONPointer) IsTopSchema() (string, bool)
type MergeOptions ¶
type MergeOptions struct { FileRx *regexp.Regexp SchemaFunc func(schemaName string, sch1, sch2 interface{}, hint2 string) CollisionCheckResult CollisionCheckResult CollisionCheckResult ValidateEach bool ValidateFinal bool TableColumns *tabulator.ColumnSet TableOpFilterFunc func(path, method string, op *oas3.Operation) bool TableAddlColFormatFuncs *OperationMoreStringFuncMap }
func NewMergeOptionsSkip ¶
func NewMergeOptionsSkip() *MergeOptions
func (*MergeOptions) CheckSchemaCollision ¶
func (mo *MergeOptions) CheckSchemaCollision(schemaName string, sch1, sch2 interface{}, hint2 string) CollisionCheckResult
type Ontology ¶ added in v1.14.0
type Ontology struct { Operations map[string]OperationMeta `json:"operationIDs"` SchemaNames []string `json:"schemaNames"` Parameters oas3.ParametersMap `json:"parameters"` }
Ontology returns the naming structure of an OpenAPI Spec. It is useful for understanding the naming conventions of an existing OpenAPI Spec. For example, the relationship of operationIDs to paths and the relationship of parameter name component keys to parameter names.
func NewOntology ¶ added in v1.14.0
func NewOntology() Ontology
type OntologySet ¶ added in v1.14.0
OntologySet is a set of ontologies which can be used to understand ontologies by a key, such as filename or by tag.
type OperationMeta ¶
type OperationMeta struct { OperationID string `json:"operationID,omitempty"` DocsDescription string `json:"docsDescription,omitempty"` Description string `json:"description,omitempty"` DocsURL string `json:"docsURL,omitempty"` Method string `json:"method,omitempty"` Path string `json:"path,omitempty"` SecurityScopes []string `json:"securityScopes,omitempty"` Summary string `json:"summary,omitempty"` Tags []string `json:"tags,omitempty"` MetaNotes []string `json:"metaNotes,omitempty"` XThrottlingGroup string `json:"x-throttlingGroup,omitempty"` RequestBodySchemaRef string `json:"requestBodySchemaRef,omitempty"` }
OperationMeta is used to hold additional information for a spec operation.
func OperationToMeta ¶
func OperationToMeta(url, method string, op *oas3.Operation, inclTags []string) *OperationMeta
OperationToMeta converts a path, method and operation to an `*OperationMeta`. The function returns `nil` if any of the items are empty.
func (*OperationMeta) Operation ¶ added in v1.17.0
func (om *OperationMeta) Operation() *oas3.Operation
func (*OperationMeta) OperationIDOrBuild ¶ added in v1.17.0
func (om *OperationMeta) OperationIDOrBuild(sep, wantCase string) (string, error)
func (*OperationMeta) PathMethod ¶ added in v1.14.0
func (om *OperationMeta) PathMethod() string
func (*OperationMeta) TrimSpace ¶
func (om *OperationMeta) TrimSpace()
type OperationMetas ¶ added in v1.17.0
type OperationMetas []*OperationMeta
type OperationMore ¶ added in v1.14.0
func OperationMoresForPath ¶ added in v1.16.0
func OperationMoresForPath(url string, pathItem *oas3.PathItem) []OperationMore
func (*OperationMore) ExtensionPropStringOrEmpty ¶ added in v1.14.0
func (om *OperationMore) ExtensionPropStringOrEmpty(key string) string
ExtensionPropStringOrEmpty converts extension prop value from `json.RawMessage` to `string`.
func (*OperationMore) HasParameter ¶ added in v1.14.0
func (om *OperationMore) HasParameter(paramNameWant string) bool
func (*OperationMore) JSONPointers ¶ added in v1.14.0
func (om *OperationMore) JSONPointers() map[string][]string
JSONPointers returns a `map[string][]string` where the keys are JSON pointers and the value slice is a slice of locations.
func (*OperationMore) Meta ¶ added in v1.14.0
func (om *OperationMore) Meta() *OperationMeta
func (*OperationMore) PathMethod ¶ added in v1.14.0
func (om *OperationMore) PathMethod() string
func (*OperationMore) RequestBodySchemaRef ¶ added in v1.14.0
func (om *OperationMore) RequestBodySchemaRef() []string
func (*OperationMore) RequestMediaTypes ¶ added in v1.14.0
func (om *OperationMore) RequestMediaTypes(spec *Spec) ([]string, error)
RequestMediaTypes returns a sorted slice of request media types.
func (*OperationMore) ResponseMediaTypes ¶ added in v1.14.0
func (om *OperationMore) ResponseMediaTypes() []string
ResponseMediaTypes returns a sorted slice of response media types. Media type values are deduped against multiple response statuses.
func (*OperationMore) SecurityScopes ¶ added in v1.14.0
func (om *OperationMore) SecurityScopes(fullyQualified bool) []string
SecurityScopes retrieves a flat list of security scopes for an operation.
type OperationMoreStringFunc ¶ added in v1.15.0
type OperationMoreStringFunc func(opm *OperationMore) string
type OperationMoreStringFuncMap ¶ added in v1.15.0
type OperationMoreStringFuncMap map[string]OperationMoreStringFunc
func (*OperationMoreStringFuncMap) Func ¶ added in v1.15.0
func (opmmap *OperationMoreStringFuncMap) Func(key string) OperationMoreStringFunc
type OperationMores ¶ added in v1.16.0
type OperationMores []OperationMore
func (*OperationMores) SummariesMap ¶ added in v1.16.0
func (oms *OperationMores) SummariesMap() map[string]string
SummariesMap returns a `map[string]string` where the keys are the operation's path and method, while the values are the summaries.
type ParameterNames ¶ added in v1.16.0
type ParameterNames struct { Components maputil.MapStringSlice Operations maputil.MapStringSlice Paths maputil.MapStringSlice }
ParameterNames covers path template parameters, operation parameter names/referecnes, compoents keys/names Parameter path names only. This is useful for viewing and modifying parameter template naems.
func NewParameterNames ¶ added in v1.16.0
func NewParameterNames() ParameterNames
func (*ParameterNames) Names ¶ added in v1.16.0
func (pn *ParameterNames) Names() []string
type PathItemMore ¶ added in v1.18.0
func (*PathItemMore) AddPathItemOperations ¶ added in v1.18.0
func (pm *PathItemMore) AddPathItemOperations(add *oas3.PathItem, overwriteOpration bool) error
type Spec ¶ added in v1.9.0
func Merge ¶
func Merge(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
func MergeDirectory ¶
func MergeDirectory(dir string, mergeOpts *MergeOptions) (*Spec, int, error)
func MergeFiles ¶
func MergeFiles(filepaths []string, mergeOpts *MergeOptions) (*Spec, error)
func MergeParameters ¶
func MergeParameters(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
func MergePaths ¶
func MergeRequestBodies ¶
func MergeResponses ¶
func MergeResponses(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
func MergeSchemas ¶
func MergeSchemas(specMaster, specExtra *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, error)
func MergeWithTables ¶
func MergeWithTables(spec1, spec2 *Spec, specExtraNote string, mergeOpts *MergeOptions) (*Spec, []*table.Table, error)
MergeWithTables performs a spec merge and returns comparison tables. This is useful to combine with github.com/grokify/gocharts/v2/data/table WriteXLSX() to write out comparison tables for debugging.
func NewSpec ¶
NewSpec returns a new OpenAPI 3 spec that will validate. Specifically, it includes an OAS version, sets `info` to be an empty object instead of null and sets apiVersion.
func Parse ¶
Parse will parse a byte array to an `*oas3.Swagger` struct. It will use JSON first. If unsuccessful, it will attempt to parse it as YAML.
type SpecMetadata ¶ added in v1.16.0
func NewSpecMetadata ¶ added in v1.16.0
func NewSpecMetadata() SpecMetadata
func (*SpecMetadata) Intersection ¶ added in v1.16.0
func (md *SpecMetadata) Intersection(md2 SpecMetadata) SpecMetadata
func (*SpecMetadata) IsEmpty ¶ added in v1.16.0
func (md *SpecMetadata) IsEmpty() bool
func (*SpecMetadata) Sort ¶ added in v1.16.0
func (md *SpecMetadata) Sort()
type SpecMore ¶
type SpecMore struct {
Spec *Spec
}
func MergeSpecMetas ¶
func MergeSpecMetas(metas *SpecMetas, validatesOnly bool, mergeOpts *MergeOptions) (SpecMore, error)
func (*SpecMore) ComponentRequestBody ¶
func (sm *SpecMore) ComponentRequestBody(componentPath string) *oas3.RequestBodyRef
func (*SpecMore) ExportByTag ¶ added in v1.14.0
ExportByTag creates an individual specs for one tag.
func (*SpecMore) ExportByTags ¶ added in v1.14.0
ExportByTags creates individual specs by tag.
func (*SpecMore) ExtensionNames ¶
ExtensionNames is not complete yet.
func (*SpecMore) HasComponentSchema ¶
func (*SpecMore) MarshalJSON ¶
func (*SpecMore) MarshalYAML ¶ added in v1.14.0
func (*SpecMore) Metadata ¶ added in v1.16.0
func (sm *SpecMore) Metadata() SpecMetadata
func (*SpecMore) Ontology ¶ added in v1.14.0
Ontology returns a populated `Ontology` struct for the spec. If no spec is supplied, a zero value is returned.
func (*SpecMore) OperationByID ¶
func (*SpecMore) OperationByPathMethod ¶ added in v1.13.0
func (*SpecMore) OperationCountsByTag ¶
OperationCountsByTag returns a histogram for operations by tag.
func (*SpecMore) OperationIDs ¶ added in v1.12.3
func (*SpecMore) OperationIDsCounts ¶ added in v1.13.0
func (*SpecMore) OperationIDsLocations ¶ added in v1.13.0
OperationIDsLocations returns a `map[string][]string` where the keys are operationIDs and the values are pathMethods for use in analyzing if there are duplicate operationIDs.
func (*SpecMore) OperationMetas ¶
func (sm *SpecMore) OperationMetas(inclTags []string) []OperationMeta
func (*SpecMore) OperationMetasMap ¶ added in v1.14.0
func (sm *SpecMore) OperationMetasMap(inclTags []string) map[string]OperationMeta
func (*SpecMore) OperationParametersDescriptionStatus ¶
func (sm *SpecMore) OperationParametersDescriptionStatus() maputil.MapStringMapStringInt
OperationParametersDescriptionStatus returns a set of operationIds and parameters with description status where `1` indicates a description and `0` indicates no descriptions. Descriptions for references aren't processed so they aren't analyzed and reported on. This returns a `MapStringMapStringInt` where the first key is the operationIds and the second key is the parameter name.
func (*SpecMore) OperationParametersDescriptionStatusCounts ¶
OperationParametersDescriptionStatusCounts returns operation parameter counts with descriptions, without descriptions, and total counts.
func (*SpecMore) OperationParametersWithoutDescriptionsWriteFile ¶
func (*SpecMore) Operations ¶ added in v1.14.0
func (sm *SpecMore) Operations(inclTags []string) *OperationMores
func (*SpecMore) OperationsCount ¶
func (*SpecMore) OperationsDescriptionInfo ¶ added in v1.13.0
OperationsDescriptionInfo returns information on operations with and without descriptions.
func (*SpecMore) OperationsTable ¶
func (*SpecMore) ParamPathNamesComponents ¶ added in v1.16.0
func (*SpecMore) ParamPathNamesOperations ¶ added in v1.16.0
func (*SpecMore) ParamPathNamesPaths ¶ added in v1.16.0
func (*SpecMore) ParameterNames ¶ added in v1.14.0
ParameterNames returns a `map[string][]string` where they key is the key in `#/components/parameters` and the values are both references and names. There should only be either a reference or a name but this structure allows capture of both.
func (*SpecMore) ParameterPathNames ¶ added in v1.16.0
func (sm *SpecMore) ParameterPathNames() ParameterNames
ParameterPathNames returns a set of parameter names. Parameter names exist in (1) path URLs, (2) operation parameters and (3) spec component parameters.
func (*SpecMore) PathMethods ¶ added in v1.16.0
func (*SpecMore) RequestBodyRef ¶ added in v1.16.2
func (sm *SpecMore) RequestBodyRef(componentKeyOrPointer string) (*oas3.RequestBodyRef, error)
func (*SpecMore) RequestBodyRefMediaTypes ¶ added in v1.16.2
func (sm *SpecMore) RequestBodyRefMediaTypes(ref *oas3.RequestBodyRef) ([]string, error)
func (*SpecMore) SchemaNameExists ¶
func (*SpecMore) SchemaNames ¶
func (*SpecMore) SchemaNamesStatus ¶ added in v1.7.0
func (*SpecMore) SchemaPointers ¶ added in v1.7.0
func (*SpecMore) SchemaPropertiesDescriptionStatus ¶
func (sm *SpecMore) SchemaPropertiesDescriptionStatus() maputil.MapStringMapStringInt
SchemaPropertiesDescriptionStatus returns a set of schema names and properties with description status where `1` indicates a description and `0` indicates no descriptions. Descriptions for references aren't processed so they aren't analyzed and reported on. This returns a `MapStringMapStringInt` where the first key is the component name and the second key is the property name.
func (*SpecMore) SchemaPropertiesDescriptionStatusCounts ¶
SchemaPropertiesDescriptionStatusCounts returns schema property counts with descriptions, without descriptions, and total counts.
func (*SpecMore) SchemaPropertiesWithoutDescriptionsWriteFile ¶
func (*SpecMore) SchemaRef ¶
SchemaRef returns a top level `SchemaRef` under `Components` based on map name or JSON pointer. It returns `nil` if the `schemaName` is not found.
func (*SpecMore) SchemaRefSet ¶ added in v1.14.0
func (*SpecMore) SchemasCopyJSONPointer ¶ added in v1.14.0
func (*SpecMore) SchemasCopyOperation ¶ added in v1.14.0
func (*SpecMore) SchemasCopySchemaRef ¶ added in v1.14.0
func (*SpecMore) SchemasCount ¶
func (*SpecMore) ServerURLBasePath ¶
ServerURLBasePath extracts the base path from a OAS URL which can include variables.
func (*SpecMore) SetOperation ¶
func (*SpecMore) SpecTagStats ¶ added in v1.13.0
func (sm *SpecMore) SpecTagStats() SpecTagStats
func (*SpecMore) StatusCodesHistogram ¶ added in v1.10.0
func (sm *SpecMore) StatusCodesHistogram() *histogram.HistogramSets
func (*SpecMore) TagsMap ¶
TagsMap returns a set of operations with tags present in the current spec.
func (*SpecMore) TagsValidate ¶ added in v1.14.0
TagsValidate checks to see if the tag names in the Spec tags property and operations match.
func (*SpecMore) ValidateMore ¶ added in v1.16.0
func (sm *SpecMore) ValidateMore() (ValidationStatus, error)
func (*SpecMore) WriteFileCSV ¶
func (sm *SpecMore) WriteFileCSV(filename string, addlColFuncs *OperationMoreStringFuncMap) error
func (*SpecMore) WriteFileJSON ¶
func (*SpecMore) WriteFileXLSX ¶
func (sm *SpecMore) WriteFileXLSX(filename string, columns *tabulator.ColumnSet, filterFunc func(path, method string, op *oas3.Operation) bool, addlColFuncs *OperationMoreStringFuncMap) error
WriteFileXLSX writes the spec in XLSX Open XML format. If supplied, the `filterFunc` must return `true` for an operation to be included in the file. if non-nil, `addlColFuncs` is used to add additional columns using `OperationMoreStringFuncMap` should return a map where the keys are column names and the values are functions that return a string to populate the cell.
func (*SpecMore) WriteFileXLSXOperationStatusCodes ¶ added in v1.10.0
type SpecTagCounts ¶ added in v1.13.0
type SpecTagStats ¶ added in v1.13.0
type SpecTagStats struct { TagStats SpecTagCounts TagsAll []string TagsDefs []string TagsOps []string TagCountsAll map[string]int TagCountsDefs map[string]int TagCountsOps map[string]int }
SpecTagStats represents tags data for tag definitions defined at the root level of a spec and tags referenced in operations.
Source Files ¶
- components.go
- constants.go
- content.go
- copy.go
- descriptions.go
- extension_props.go
- inspect.go
- intersection.go
- json_pointer.go
- merge.go
- merge_options.go
- ontology.go
- openapi3_url.go
- operation_meta.go
- operation_more.go
- parameter.go
- path.go
- path_more.go
- read.go
- schemas.go
- spec_meta.go
- spec_more.go
- spec_more_export.go
- spec_table_response_status.go
- visit.go