springopenapi3

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 7 Imported by: 3

README

From Spring

This package provides some code useful for converting Spring Java code to OpenAPI 3.0. At this moment it only converts Spring model classes to OpenAPI 3.0 schema objects.

Documentation

Index

Constants

View Source
const (
	TypeArray            = openapi3.TypeArray
	TypeBoolean          = openapi3.TypeBoolean
	TypeInteger          = openapi3.TypeInteger
	TypeObject           = openapi3.TypeObject
	TypeString           = openapi3.TypeString
	FormatStringDate     = openapi3.FormatDate
	FormatStringDateTime = openapi3.FormatDateTime
	FormatIntegerInt64   = openapi3.FormatInt64
)

Variables

This section is empty.

Functions

func ParseSpringCodeColumnsRaw

func ParseSpringCodeColumnsRaw(input []string) [][]string

ParseSpringCodeColumnsRaw takes a set of Java code lines and groups them into lines per property. Not all Java code may be formatted in a way to take advantage of this. noinspection ALL

func ParseSpringLineToSchema

func ParseSpringLineToSchema(line string) (string, *oas3.Schema, error)

ParseSpringLineToSchema parses a Spring Java code line and attempts to extract a property name, type, format and default value. DEPRECATED

func ParseSpringLineToSchemaRef

func ParseSpringLineToSchemaRef(line string, explicitCustomTypes []string) (string, *oas3.SchemaRef, error)

ParseSpringLineToSchemaRef parses a Spring Java code line and attempts to extract a property name, type, format and default value.

func ParseSpringLinesToMapStringSchemaRefs

func ParseSpringLinesToMapStringSchemaRefs(lines, explicitCustomTypes []string) (map[string]*oas3.SchemaRef, error)

ParseSpringLinesToMapStringSchemaRefs parses a Spring Java code line and attempts to extract a property name, type, format and default value.

func ParseSpringPropertyLinesSliceToSchema

func ParseSpringPropertyLinesSliceToSchema(groups [][]string) (map[string]*oas3.SchemaRef, error)

ParseSpringPropertyLinesSliceToSchema takes a set of string slices and attempts to parse one property per set of lines. noinspection ALL

func ParseSpringPropertyLinesToSchema

func ParseSpringPropertyLinesToSchema(lines []string) (string, *oas3.Schema, error)

ParseSpringPropertyLinesToSchema parses a set of lines looking for a property line. Only one property line is matched in this set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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