petstore

package
v1.23.10 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 3 Imported by: 0

README

OpenAPI Schema Formats

This tests the OpenAPI schema formats feature of Astra. It is a simple example of how to use OpenAPI schema formats to create a new format that can be used. This tests:

  • Creating a custom date-time format for the time.Time type, and uuid.UUID type from google for uuid format.
  • int32 is the default format for int types
  • int64 is respected for int64 types
  • float32 is the default format for float32 types
  • float64 is respected for float64 types
  • Accounted for all other data types in formatTypes.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestStructFormatter

type TestStructFormatter struct {
	// String
	String string `json:"string,omitempty"`
	// Int (int32)
	Int int `json:"int,omitempty"`
	// Int8
	Int8 int8 `json:"int8,omitempty"`
	// Int16
	Int16 int16 `json:"int16,omitempty"`
	// Int32
	Int32 int32 `json:"int32,omitempty"`
	// Int64
	Int64 int64 `json:"int64,omitempty"`
	// Uint
	Uint uint `json:"uint,omitempty"`
	// Uint8
	Uint8 uint8 `json:"uint8,omitempty"`
	// Uint16
	Uint16 uint16 `json:"uint16,omitempty"`
	// Uint32
	Uint32 uint32 `json:"uint32,omitempty"`
	// Uint64
	Uint64 uint64 `json:"uint64,omitempty"`
	// Float32
	Float32 float32 `json:"float32,omitempty"`
	// Float64
	Float64 float64 `json:"float64,omitempty"`
	// Bool
	Bool bool `json:"bool,omitempty"`
	// Byte
	Byte byte `json:"byte,omitempty"`
	// Rune
	Rune rune `json:"rune,omitempty"`
	// Struct
	Struct struct{} `json:"struct,omitempty"`
	// Map
	Map map[string]string `json:"map,omitempty"`
	// Slice
	Slice []string `json:"slice,omitempty"`
	// Any
	Any any `json:"any,omitempty"`

	// time.Time
	Time time.Time `json:"time,omitempty"`
	// uuid.UUID
	UUID uuid.UUID `json:"uuid,omitempty"`
}

Jump to

Keyboard shortcuts

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