api2

package
v0.0.0-...-4cf73da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 5 Imported by: 0

README

Package api2

Purpose

This package extracts schemas metadata from OpenAPI files version 2. If your OpenAPI file is using newer version 3 check out api3 package.

Description

Before extracting metadata from OpenAPI, the schema is initially converted from V2 to V3 format. For further details, refer to the api3 package README, as the remaining process follows the same approach as api3. This pacakge acts as a gateway and a wrapper of api3.

Loading File

var (
    // Static file containing openapi spec.
    //
    //go:embed specs.json
    apiFile []byte

	FileManager = api2.NewOpenapiFileManager(apiFile) // nolint:gochecknoglobals
)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenapiFileManager

type OpenapiFileManager struct {
	// contains filtered or unexported fields
}

OpenapiFileManager locates openapi file. Allows to read data of interest. Use it when dealing with OpenAPI v2.

func NewOpenapiFileManager

func NewOpenapiFileManager(file []byte) *OpenapiFileManager

func (OpenapiFileManager) GetExplorer

func (m OpenapiFileManager) GetExplorer(opts ...api3.Option) (*api3.Explorer, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL