fromspring

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 6 Imported by: 0

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            string = "array"
	TypeBoolean          string = "boolean"
	TypeInteger          string = "integer"
	TypeObject           string = "object"
	TypeString           string = "string"
	FormatStringDate     string = "date"
	FormatStringDateTime string = "date-time"
	FormatIntegerInt64   string = "int64"
)

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