Documentation ¶
Index ¶
- Constants
- func ImportOpenAPIDocumentByte(input []byte) (*ast.Document, operationreport.Report)
- func ImportOpenAPIDocumentString(input string) (*ast.Document, operationreport.Report)
- func ImportParsedOpenAPIv3Document(document *openapi3.T, report *operationreport.Report) *ast.Document
- func MakeFieldNameFromEndpoint(endpoint string) string
- func MakeFieldNameFromEndpointForMutation(method, endpoint string) string
- func MakeFieldNameFromOperationID(operationID string) string
- func MakeInputTypeName(name string) string
- func MakeParameterName(name string) string
- func MakeTypeNameFromPathName(name string) string
- func ParseOpenAPIDocument(input []byte) (*openapi3.T, error)
Constants ¶
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 MakeInputTypeName ¶
func MakeParameterName ¶
func ParseOpenAPIDocument ¶
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.