openapi

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

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const JsonScalarType = "JSON"

Variables

This section is empty.

Functions

func ImportOpenAPIDocumentByte

func ImportOpenAPIDocumentByte(input []byte) (*ast.Document, operationreport.Report)

ImportOpenAPIDocumentByte imports an OpenAPI document from a byte slice input. It first parses the input using the ParseOpenAPIDocument function. If there is an error during parsing, it adds the error to the operationreport.Report and returns nil with the report. Otherwise, it passes the parsed document to the ImportParsedOpenAPIv3Document function along with the operationreport.Report, and returns the imported OpenAPI document as ast.Document and the report.

func ImportOpenAPIDocumentString

func ImportOpenAPIDocumentString(input string) (*ast.Document, operationreport.Report)

ImportOpenAPIDocumentString imports an OpenAPI document from a string input. It delegates to ImportOpenAPIDocumentByte, passing the input as a byte slice. The function returns the imported OpenAPI document as ast.Document and an operationreport.Report. If there are any errors during the import process, they will be included in the report.

func ImportParsedOpenAPIv3Document

func ImportParsedOpenAPIv3Document(document *openapi3.T, report *operationreport.Report) *ast.Document

ImportParsedOpenAPIv3Document imports a parsed OpenAPI v3 document and converts it into a GraphQL AST Document.

func MakeFieldNameFromEndpoint

func MakeFieldNameFromEndpoint(endpoint string) string

func MakeFieldNameFromEndpointForMutation

func MakeFieldNameFromEndpointForMutation(method, endpoint string) string

func MakeFieldNameFromOperationID

func MakeFieldNameFromOperationID(operationID string) string

func MakeInputTypeName

func MakeInputTypeName(name string) string

func MakeParameterName

func MakeParameterName(name string) string

func MakeTypeNameFromPathName

func MakeTypeNameFromPathName(name string) string

func ParseOpenAPIDocument

func ParseOpenAPIDocument(input []byte) (*openapi3.T, error)

ParseOpenAPIDocument parses an OpenAPI document from a byte slice input. It creates a new loader with IsExternalRefsAllowed set to true. The loader then loads the document from the input data, returning any errors encountered. If the document is successfully loaded, it is validated using the loader's context. If validation fails, the validation error is returned. Otherwise, the parsed document is returned along with a nil error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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