Documentation
¶
Index ¶
Constants ¶
const ( RAMLKeyDescription = "description" RAMLKeyDisplayName = "displayName" )
Variables ¶
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") )
var ErrOperationMissing = errors.New("operation is not set")
Functions ¶
func NewSpec ¶ added in v1.22.0
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.