raml08openapi3

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RAMLKeyDescription = "description"
	RAMLKeyDisplayName = "displayName"
)

Variables

View Source
var (
	ErrOperationMoreSetMissing  = errors.New("required parameter operationSetMore is empty")
	ErrRAMLDescriptionNotString = errors.New("format for RAML description is not string")
	ErrRAMLDispNameNotString    = errors.New("format for RAML displayName is not string")
	ErrRAMLMethodNotObject      = errors.New("format for RAML method is not object")
)
View Source
var ErrOperationMissing = errors.New("operation is not set")

Functions

func NewSpec added in v1.22.0

func NewSpec(oms openapi3.OperationMores, apiTitle, apiVersion string) (*openapi3.Spec, error)

NewSpec returns an OpenAPI 3 spec holding the operations read from a RAML v0.8 file by `ReadFileOperations`, with the given API title and version. It returns an error when an operation is not set or when two operations share a path and method.

func ReadFileOperations

func ReadFileOperations(filename string) (*openapi3.OperationMores, error)

ReadFileOperations reads a RAML v0.8 file and returns a set of `openapi3edit.OperationMore` structs. The properties `path`, `method`, `summary`, `description` and `tags` are populated. OpenAPI `summary` is populated by the method's `displayName` property, and `tags` by its resource's `displayName`. Currently, this reads a JSON formatted file into a map[string]interface. This is useful after converting a RAML v0.8 spec using https://github.com/daviemakz/oas-raml-converter-cli.

Types

This section is empty.

Jump to

Keyboard shortcuts

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