{"modulePath":"github.com/elasticpath/epcc-cli","version":"v0.15.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package openapi\n\n## Functions\n\n```go\nfunc GetAllOperationIDs() (map[string]OperationIDInfo, error)\n```\nGetAllOperationIDs returns a map of all operation IDs found in all OpenAPI specs. The map key is the operation ID and the value is information about where it's defined. This is useful for validating operation IDs referenced in other parts of the codebase.\n\nExample:\n\n\tallOperationIDs, err := GetAllOperationIDs()\n\tif err != nil {\n\t    log.Fatalf(\"Failed to get operation IDs: %v\", err)\n\t}\n\n\t// Check if a specific operation ID exists\n\tif opInfo, exists := allOperationIDs[\"createProduct\"]; exists {\n\t    fmt.Printf(\"Operation found in %s at path %s using method %s\\n\",\n\t        opInfo.SpecName, opInfo.Path, opInfo.Method)\n\t}\n\n\t// Print all operation IDs\n\tfor opID, opInfo := range allOperationIDs {\n\t    fmt.Printf(\"%s: %s %s in %s\\n\", opID, opInfo.Method, opInfo.Path, opInfo.SpecName)\n\t}\n\n```go\nfunc GetAllSpecModels() (map[string]*SpecModel, error)\n```\nGetAllSpecModels returns all available OpenAPI specs as libopenapi models\n\n```go\nfunc GetOpenAPISpec(name string) ([]byte, error)\n```\nGetOpenAPISpec returns the content of an OpenAPI spec file by name\n\n## Types\n\n```go\ntype OperationIDInfo struct {\n\tSpecName string // Name of the OpenAPI spec file (without extension)\n\tPath     string // Path in the OpenAPI spec (e.g., \"/v2/products/{id}\")\n\tMethod   string // HTTP method (e.g., \"GET\", \"POST\", etc.)\n\tSummary  string // Summary description of the operation\n}\n```\nOperationIDInfo contains information about an operation ID and where it's defined\n\n```go\ntype OperationInfo struct {\n\tSpecName    string        // Name of the OpenAPI spec file (without extension)\n\tPath        string        // Path in the OpenAPI spec (e.g., \"/v2/products/{id}\")\n\tMethod      string        // HTTP method (e.g., \"GET\", \"POST\", etc.)\n\tOperationID string        // The operationId from the OpenAPI spec\n\tSummary     string        // Summary description of the operation\n\tOperation   *v3.Operation // The actual OpenAPI v3 Operation object\n}\n```\nOperationInfo represents information about an operation in an OpenAPI spec\n\n```go\nfunc FindOperationByID(operationID string) (*OperationInfo, error)\n```\nFindOperationByID searches all OpenAPI specs for an operation with the given ID and returns information about the operation if found.\n\nExample:\n\n\topInfo, err := FindOperationByID(\"getProduct\")\n\tif err != nil {\n\t    log.Fatalf(\"Operation not found: %v\", err)\n\t}\n\tfmt.Printf(\"Found operation in %s at path %s using method %s\\n\",\n\t    opInfo.SpecName, opInfo.Path, opInfo.Method)\n\n```go\ntype QueryParamInfo struct {\n\tName        string\n\tEpccCliType string\n}\n```\n\n```go\nfunc GetQueryParametersForOperation(operationID string) ([]*QueryParamInfo, error)\n```\nGetQueryParametersForOperation returns the query parameter names for a given operation ID\n\n```go\ntype SpecModel struct {\n\tName     string\n\tDocument libopenapi.Document\n\tV3Model  v3.Document\n}\n```\nSpecModel represents an OpenAPI spec model with its metadata\n\n```go\nfunc GetSpecModel(name string) (*SpecModel, error)\n```\nGetSpecModel returns a specific OpenAPI spec as a libopenapi model\n\n```go\ntype TagInfo struct {\n\tName        string\n\tDescription string\n}\n```\n\n```go\nfunc FindTagByName(tag string) (*TagInfo, string, error)\n```\n\n","path":"github.com/elasticpath/epcc-cli/external/openapi","name":"openapi","synopsis":"","isRedistributable":true}
