genopenapi

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(inputs ...string) error

Types

type OASComponent

type OASComponent struct {
	SecuritySchemes map[string]OASSecurityScheme `json:"securitySchemes"`
	Parameters      map[string]OASParameter      `json:"parameters,omitempty"`
	Schemes         map[string]OASSchema         `json:"schemes"`
}

type OASContact

type OASContact struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Url   string `json:"url"`
}

type OASExample

type OASExample struct {
	Description   string `json:"description"`
	Summary       string `json:"summary"`
	Value         any    `json:"value"`
	ExternalValue string `json:"externalValue"`
}

type OASExternalDocumentation

type OASExternalDocumentation struct {
	Description string `json:"description"`
	URL         string `json:"url"`
}

type OASInfo

type OASInfo struct {
	Title          string     `json:"title"`
	Version        string     `json:"version"`
	Description    string     `json:"description"`
	TermsOfService string     `json:"termsOfService"`
	Contact        OASContact `json:"contact"`
	License        OASLicense `json:"license"`
}

type OASLicense

type OASLicense struct {
	Name string `json:"name"`
	Url  string `json:"url"`
}

type OASMediaType

type OASMediaType struct {
	Schema   OASSchema             `json:"schema,omitempty"`
	Example  any                   `json:"example,omitempty"`
	Examples map[string]OASExample `json:"examples,omitempty"`
}

type OASOperationObject

type OASOperationObject struct {
	Tags        []string               `json:"tags"`
	Summary     string                 `json:"summary,omitempty"`
	OperationID string                 `json:"operationId"`
	Parameters  []OASParameter         `json:"parameters"`
	RequestBody OASRequestBody         `json:"requestBody"`
	Responses   map[string]OASResponse `json:"responses"`
}

type OASParameter

type OASParameter struct {
	Name        string                `json:"name"`
	In          string                `json:"in"`
	Description string                `json:"description"`
	Required    bool                  `json:"required"`
	Schema      OASSchema             `json:"schema"`
	Example     any                   `json:"example,omitempty"`
	Examples    map[string]OASExample `json:"examples,omitempty"`
}

type OASPathItem

type OASPathItem struct {
	Get         OASOperationObject `json:"get,omitempty"`
	Post        OASOperationObject `json:"post,omitempty"`
	Put         OASOperationObject `json:"put,omitempty"`
	Delete      OASOperationObject `json:"delete,omitempty"`
	Summary     string             `json:"summary,omitempty"`
	Description string             `json:"description,omitempty"`
	Ref         string             `json:"$ref"`
	Servers     OASServer          `json:"servers,omitempty"`
	Parameters  OASParameter       `json:"parameters,omitempty"`
}

type OASRequestBody

type OASRequestBody struct {
	Description string                  `json:"description,omitempty"`
	Content     map[string]OASMediaType `json:"content"`
	Required    bool                    `json:"required,omitempty"`
}

type OASResponse

type OASResponse struct {
	Description string                  `json:"description,omitempty"`
	Content     map[string]OASMediaType `json:"content"`
}

type OASRoot

type OASRoot struct {
	OpenAPI      string                   `json:"openapi"`
	Info         OASInfo                  `json:"info"`
	Servers      []OASServer              `json:"servers"`
	ExternalDocs OASExternalDocumentation `json:"externalDocs"`
	Paths        map[string]OASPathItem   `json:"paths"`
	Components   map[string]OASComponent  `json:"components"`
}

type OASSchema

type OASSchema struct {
	Ref        string   `json:"$ref,omitempty"`
	Type       string   `json:"type,omitempty"`
	Properties []any    `json:"properties,omitempty"`
	Required   bool     `json:"required,omitempty"`
	Default    string   `json:"default,omitempty"`
	Enum       []string `json:"enum"`
}

type OASSecurityScheme

type OASSecurityScheme struct {
}

type OASServer

type OASServer struct {
	Description string                       `json:"description"`
	Url         string                       `json:"url"`
	Variables   map[string]OASServerVariable `json:"variables"`
}

type OASServerVariable

type OASServerVariable struct {
	Description string   `json:"description,omitempty"`
	Default     string   `json:"default"`
	Enum        []string `json:"enum,omitempty"`
}

type ObjTemplate

type ObjTemplate struct {
	GomodPath     string
	DefaultDomain string
}

ObjTemplate ...

Jump to

Keyboard shortcuts

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