gen

package
v1.13.9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DenormalizeObject

func DenormalizeObject(name string, schema *spec.Schema) map[string]string

DenormalizeObject accepts a schema and returns a map of its properties, fully expanded to the lowest level. Note that the one exception to this is for arrays of objects. The `GetType` function explicitly does not support arrays of objects, so we don't expand those (this is due to there being no way to specify an array of objects in a shell).

We denormalize into a dot-notation since that has the most compatibility across shells. This is not following proper conventions (as per https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html), but our API is becoming increasingly complex and dot-notation is the most compatible way to handle it (brackets are not supported in all shells).

func GetType

func GetType(schema *spec.Schema) *string

GetType accepts a schema and returns its scalar type, if it has one.

If the schema is monomorphic, it returns its type if it's scalar.

If the schema is polymorphic, it returns the first scalar type for the schema, if there is any.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳