openapi

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 9 Imported by: 29

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

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.

Jump to

Keyboard shortcuts

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