petstoreserver

package
v4.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

Go API Server for petstoreserver

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \

Overview

This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

To see how to make this your own, look here:

README

  • API version: 1.0.0
Running the server

To run the server, follow these simple steps:

go run main.go

To run the server in a docker container

docker build --network=host -t petstoreserver .

Once image is built use

docker run --rm -it petstoreserver 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPet

func AddPet(w http.ResponseWriter, r *http.Request)

AddPet - Add a new pet to the store

func Call123TestSpecialTags

func Call123TestSpecialTags(w http.ResponseWriter, r *http.Request)

Call123TestSpecialTags - To test special tags

func CreateUser

func CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser - Create user

func CreateUsersWithArrayInput

func CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request)

CreateUsersWithArrayInput - Creates list of users with given input array

func CreateUsersWithListInput

func CreateUsersWithListInput(w http.ResponseWriter, r *http.Request)

CreateUsersWithListInput - Creates list of users with given input array

func DeleteOrder

func DeleteOrder(w http.ResponseWriter, r *http.Request)

DeleteOrder - Delete purchase order by ID

func DeletePet

func DeletePet(w http.ResponseWriter, r *http.Request)

DeletePet - Deletes a pet

func DeleteUser

func DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser - Delete user

func FakeHealthGet

func FakeHealthGet(w http.ResponseWriter, r *http.Request)

FakeHealthGet - Health check endpoint

func FakeOuterBooleanSerialize

func FakeOuterBooleanSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterBooleanSerialize -

func FakeOuterCompositeSerialize

func FakeOuterCompositeSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterCompositeSerialize -

func FakeOuterNumberSerialize

func FakeOuterNumberSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterNumberSerialize -

func FakeOuterStringSerialize

func FakeOuterStringSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterStringSerialize -

func FindPetsByStatus

func FindPetsByStatus(w http.ResponseWriter, r *http.Request)

FindPetsByStatus - Finds Pets by status

func FindPetsByTags

func FindPetsByTags(w http.ResponseWriter, r *http.Request)

FindPetsByTags - Finds Pets by tags

func FooGet

func FooGet(w http.ResponseWriter, r *http.Request)

FooGet -

func GetInventory

func GetInventory(w http.ResponseWriter, r *http.Request)

GetInventory - Returns pet inventories by status

func GetOrderById

func GetOrderById(w http.ResponseWriter, r *http.Request)

GetOrderById - Find purchase order by ID

func GetPetById

func GetPetById(w http.ResponseWriter, r *http.Request)

GetPetById - Find pet by ID

func GetUserByName

func GetUserByName(w http.ResponseWriter, r *http.Request)

GetUserByName - Get user by user name

func Index

func Index(w http.ResponseWriter, r *http.Request)

func Logger

func Logger(inner http.Handler, name string) http.Handler

func LoginUser

func LoginUser(w http.ResponseWriter, r *http.Request)

LoginUser - Logs user into the system

func LogoutUser

func LogoutUser(w http.ResponseWriter, r *http.Request)

LogoutUser - Logs out current logged in user session

func NewRouter

func NewRouter() *mux.Router

func PlaceOrder

func PlaceOrder(w http.ResponseWriter, r *http.Request)

PlaceOrder - Place an order for a pet

func TestBodyWithFileSchema

func TestBodyWithFileSchema(w http.ResponseWriter, r *http.Request)

TestBodyWithFileSchema -

func TestBodyWithQueryParams

func TestBodyWithQueryParams(w http.ResponseWriter, r *http.Request)

TestBodyWithQueryParams -

func TestClassname

func TestClassname(w http.ResponseWriter, r *http.Request)

TestClassname - To test class name in snake case

func TestClientModel

func TestClientModel(w http.ResponseWriter, r *http.Request)

TestClientModel - To test \"client\" model

func TestEndpointParameters

func TestEndpointParameters(w http.ResponseWriter, r *http.Request)

TestEndpointParameters - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

func TestEnumParameters

func TestEnumParameters(w http.ResponseWriter, r *http.Request)

TestEnumParameters - To test enum parameters

func TestGroupParameters

func TestGroupParameters(w http.ResponseWriter, r *http.Request)

TestGroupParameters - Fake endpoint to test group parameters (optional)

func TestInlineAdditionalProperties

func TestInlineAdditionalProperties(w http.ResponseWriter, r *http.Request)

TestInlineAdditionalProperties - test inline additionalProperties

func TestJsonFormData

func TestJsonFormData(w http.ResponseWriter, r *http.Request)

TestJsonFormData - test json serialization of form data

func UpdatePet

func UpdatePet(w http.ResponseWriter, r *http.Request)

UpdatePet - Update an existing pet

func UpdatePetWithForm

func UpdatePetWithForm(w http.ResponseWriter, r *http.Request)

UpdatePetWithForm - Updates a pet in the store with form data

func UpdateUser

func UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser - Updated user

func UploadFile

func UploadFile(w http.ResponseWriter, r *http.Request)

UploadFile - uploads an image

func UploadFileWithRequiredFile

func UploadFileWithRequiredFile(w http.ResponseWriter, r *http.Request)

UploadFileWithRequiredFile - uploads an image (required)

Types

type AdditionalPropertiesClass

type AdditionalPropertiesClass struct {
	MapProperty map[string]string `json:"map_property,omitempty"`

	MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"`
}

type Animal

type Animal struct {
	ClassName string `json:"className"`

	Color string `json:"color,omitempty"`
}

type ApiResponse

type ApiResponse struct {
	Code int32 `json:"code,omitempty"`

	Type string `json:"type,omitempty"`

	Message string `json:"message,omitempty"`
}

type ArrayOfArrayOfNumberOnly

type ArrayOfArrayOfNumberOnly struct {
	ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"`
}

type ArrayOfNumberOnly

type ArrayOfNumberOnly struct {
	ArrayNumber []float32 `json:"ArrayNumber,omitempty"`
}

type ArrayTest

type ArrayTest struct {
	ArrayOfString []string `json:"array_of_string,omitempty"`

	ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"`

	ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"`
}

type Capitalization

type Capitalization struct {
	SmallCamel string `json:"smallCamel,omitempty"`

	CapitalCamel string `json:"CapitalCamel,omitempty"`

	SmallSnake string `json:"small_Snake,omitempty"`

	CapitalSnake string `json:"Capital_Snake,omitempty"`

	SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty"`

	// Name of the pet
	ATT_NAME string `json:"ATT_NAME,omitempty"`
}

type Cat

type Cat struct {
	ClassName string `json:"className"`

	Color string `json:"color,omitempty"`

	Declawed bool `json:"declawed,omitempty"`
}

type Category

type Category struct {
	Id int64 `json:"id,omitempty"`

	Name string `json:"name"`
}

type ClassModel

type ClassModel struct {
	Class string `json:"_class,omitempty"`
}

ClassModel - Model for testing model with \"_class\" property

type Client

type Client struct {
	Client string `json:"client,omitempty"`
}

type Dog

type Dog struct {
	ClassName string `json:"className"`

	Color string `json:"color,omitempty"`

	Breed string `json:"breed,omitempty"`
}

type EnumArrays

type EnumArrays struct {
	JustSymbol string `json:"just_symbol,omitempty"`

	ArrayEnum []string `json:"array_enum,omitempty"`
}

type EnumClass

type EnumClass string
const (
	ABC EnumClass = "_abc"
	EFG EnumClass = "-efg"
	XYZ EnumClass = "(xyz)"
)

List of EnumClass

type EnumTest

type EnumTest struct {
	EnumString string `json:"enum_string,omitempty"`

	EnumStringRequired string `json:"enum_string_required"`

	EnumInteger int32 `json:"enum_integer,omitempty"`

	EnumNumber float64 `json:"enum_number,omitempty"`

	OuterEnum OuterEnum `json:"outerEnum,omitempty"`

	OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"`

	OuterEnumDefaultValue OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"`

	OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"`
}

type File

type File struct {

	// Test capitalization
	SourceURI string `json:"sourceURI,omitempty"`
}

File - Must be named `File` for test.

type FileSchemaTestClass

type FileSchemaTestClass struct {
	File File `json:"file,omitempty"`

	Files []File `json:"files,omitempty"`
}

type Foo

type Foo struct {
	Bar string `json:"bar,omitempty"`
}

type FormatTest

type FormatTest struct {
	Integer int32 `json:"integer,omitempty"`

	Int32 int32 `json:"int32,omitempty"`

	Int64 int64 `json:"int64,omitempty"`

	Number float32 `json:"number"`

	Float float32 `json:"float,omitempty"`

	Double float64 `json:"double,omitempty"`

	String string `json:"string,omitempty"`

	Byte string `json:"byte"`

	Binary *os.File `json:"binary,omitempty"`

	Date string `json:"date"`

	DateTime time.Time `json:"dateTime,omitempty"`

	Uuid string `json:"uuid,omitempty"`

	Password string `json:"password"`

	// A string that is a 10 digit number. Can have leading zeros.
	PatternWithDigits string `json:"pattern_with_digits,omitempty"`

	// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
	PatternWithDigitsAndDelimiter string `json:"pattern_with_digits_and_delimiter,omitempty"`
}

type HasOnlyReadOnly

type HasOnlyReadOnly struct {
	Bar string `json:"bar,omitempty"`

	Foo string `json:"foo,omitempty"`
}

type HealthCheckResult

type HealthCheckResult struct {
	NullableMessage *string `json:"NullableMessage,omitempty"`
}

HealthCheckResult - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.

type InlineObject

type InlineObject struct {

	// Updated name of the pet
	Name string `json:"name,omitempty"`

	// Updated status of the pet
	Status string `json:"status,omitempty"`
}

type InlineObject1

type InlineObject1 struct {

	// Additional data to pass to server
	AdditionalMetadata string `json:"additionalMetadata,omitempty"`

	// file to upload
	File *os.File `json:"file,omitempty"`
}

type InlineObject2

type InlineObject2 struct {

	// Form parameter enum test (string array)
	EnumFormStringArray []string `json:"enum_form_string_array,omitempty"`

	// Form parameter enum test (string)
	EnumFormString string `json:"enum_form_string,omitempty"`
}

type InlineObject3

type InlineObject3 struct {

	// None
	Integer int32 `json:"integer,omitempty"`

	// None
	Int32 int32 `json:"int32,omitempty"`

	// None
	Int64 int64 `json:"int64,omitempty"`

	// None
	Number float32 `json:"number"`

	// None
	Float float32 `json:"float,omitempty"`

	// None
	Double float64 `json:"double"`

	// None
	String string `json:"string,omitempty"`

	// None
	PatternWithoutDelimiter string `json:"pattern_without_delimiter"`

	// None
	Byte string `json:"byte"`

	// None
	Binary *os.File `json:"binary,omitempty"`

	// None
	Date string `json:"date,omitempty"`

	// None
	DateTime time.Time `json:"dateTime,omitempty"`

	// None
	Password string `json:"password,omitempty"`

	// None
	Callback string `json:"callback,omitempty"`
}

type InlineObject4

type InlineObject4 struct {

	// field1
	Param string `json:"param"`

	// field2
	Param2 string `json:"param2"`
}

type InlineObject5

type InlineObject5 struct {

	// Additional data to pass to server
	AdditionalMetadata string `json:"additionalMetadata,omitempty"`

	// file to upload
	RequiredFile *os.File `json:"requiredFile"`
}

type InlineResponseDefault

type InlineResponseDefault struct {
	String Foo `json:"string,omitempty"`
}

type List

type List struct {
	Var123List string `json:"123-list,omitempty"`
}

type MapTest

type MapTest struct {
	MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"`

	MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"`

	DirectMap map[string]bool `json:"direct_map,omitempty"`

	IndirectMap map[string]bool `json:"indirect_map,omitempty"`
}

type MixedPropertiesAndAdditionalPropertiesClass

type MixedPropertiesAndAdditionalPropertiesClass struct {
	Uuid string `json:"uuid,omitempty"`

	DateTime time.Time `json:"dateTime,omitempty"`

	Map map[string]Animal `json:"map,omitempty"`
}

type Model200Response

type Model200Response struct {
	Name int32 `json:"name,omitempty"`

	Class string `json:"class,omitempty"`
}

Model200Response - Model for testing model name starting with number

type Name

type Name struct {
	Name int32 `json:"name"`

	SnakeCase int32 `json:"snake_case,omitempty"`

	Property string `json:"property,omitempty"`

	Var123Number int32 `json:"123Number,omitempty"`
}

Name - Model for testing model name same as property name

type NumberOnly

type NumberOnly struct {
	JustNumber float32 `json:"JustNumber,omitempty"`
}

type Order

type Order struct {
	Id int64 `json:"id,omitempty"`

	PetId int64 `json:"petId,omitempty"`

	Quantity int32 `json:"quantity,omitempty"`

	ShipDate time.Time `json:"shipDate,omitempty"`

	// Order Status
	Status string `json:"status,omitempty"`

	Complete bool `json:"complete,omitempty"`
}

type OuterComposite

type OuterComposite struct {
	MyNumber float32 `json:"my_number,omitempty"`

	MyString string `json:"my_string,omitempty"`

	MyBoolean bool `json:"my_boolean,omitempty"`
}

type OuterEnum

type OuterEnum string
const (
	PLACED    OuterEnum = "placed"
	APPROVED  OuterEnum = "approved"
	DELIVERED OuterEnum = "delivered"
)

List of OuterEnum

type OuterEnumDefaultValue

type OuterEnumDefaultValue string
const (
	PLACED    OuterEnumDefaultValue = "placed"
	APPROVED  OuterEnumDefaultValue = "approved"
	DELIVERED OuterEnumDefaultValue = "delivered"
)

List of OuterEnumDefaultValue

type OuterEnumInteger

type OuterEnumInteger int32

type OuterEnumIntegerDefaultValue

type OuterEnumIntegerDefaultValue int32

type Pet

type Pet struct {
	Id int64 `json:"id,omitempty"`

	Category Category `json:"category,omitempty"`

	Name string `json:"name"`

	PhotoUrls []string `json:"photoUrls"`

	Tags []Tag `json:"tags,omitempty"`

	// pet status in the store
	Status string `json:"status,omitempty"`
}

type ReadOnlyFirst

type ReadOnlyFirst struct {
	Bar string `json:"bar,omitempty"`

	Baz string `json:"baz,omitempty"`
}

type Return

type Return struct {
	Return int32 `json:"return,omitempty"`
}

Return - Model for testing reserved words

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type SpecialModelName

type SpecialModelName struct {
	SpecialPropertyName int64 `json:"$special[property.name],omitempty"`
}

type Tag

type Tag struct {
	Id int64 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

type User

type User struct {
	Id int64 `json:"id,omitempty"`

	Username string `json:"username,omitempty"`

	FirstName string `json:"firstName,omitempty"`

	LastName string `json:"lastName,omitempty"`

	Email string `json:"email,omitempty"`

	Password string `json:"password,omitempty"`

	Phone string `json:"phone,omitempty"`

	// User Status
	UserStatus int32 `json:"userStatus,omitempty"`
}

Jump to

Keyboard shortcuts

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