gocuelang.org/go/encoding/openapi Index | Files

package openapi

import "cuelang.org/go/encoding/openapi"

Package openapi provides functionality for mapping CUE to and from OpenAPI v3.0.0.

It currently handles OpenAPI Schema components only.

See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject.

Index

Functions

func Gen

func Gen(inst *cue.Instance, c *Config) ([]byte, error)

Gen generates the set OpenAPI schema for all top-level types of the given instance.

Types

type Config

type Config struct {
	// ExpandReferences replaces references with actual objects when generating
	// OpenAPI Schema. It is an error for an CUE value to refer to itself
	// when this object is used.
	ExpandReferences bool
}

A Config defines options for mapping CUE to and from OpenAPI.

Source Files

build.go doc.go errors.go openapi.go orderedmap.go

Version
v0.0.3
Published
Jun 26, 2019
Platform
linux/amd64
Imports
9 packages
Last checked
3 minutes ago

Tools for package owners.