jsclient

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrimitiveTypes = map[string]bool{
	"string":  true,
	"number":  true,
	"integer": true,
	"boolean": true,
	"array":   true,
	"object":  true,
}

PrimitiveTypes is a set of Swagger primitive types

Functions

func Generate

func Generate(modulePath string, s spec.Swagger) error

Generate generates a client

Types

type DataType

type DataType struct {
	Name string
	Ref  *string
}

DataType represents a primitive or defined type

type JSType

type JSType string

JSType is a wrapper type for things that represent a TypeScript type

func ReturnType

func ReturnType(s spec.Swagger, op *spec.Operation) (JSType, error)

ReturnType returns the methods return type

type JSTypeMap

type JSTypeMap map[string]JSType

JSTypeMap is a representation of a TypeScript object

type Param

type Param struct {
	Name string
	Type DataType
}

Param represents a function's formal parameter

type TypeScriptErrorDeclaration

type TypeScriptErrorDeclaration struct {
	Name       string
	Properties []string
}

TypeScriptErrorDeclaration holds attributes for an Error Type Decclaration

Jump to

Keyboard shortcuts

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