diff

package
v0.0.0-...-4d495be Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionAdded    = Action("added")
	ActionDeleted  = Action("deleted")
	ActionModified = Action("modified")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

type Config

type Config struct {
	OutputFormat string `json:"output_format,omitempty"` // json, html, markdown, text
}

Config represents the config for a models.SpecDiff (SpecDiff.Config)

type EndpointSummary

type EndpointSummary struct {
	Path        string `json:"path"`
	Method      string `json:"method"`
	Description string `json:"description"`

	Message string `json:"message"`
}

type JSONResult

type JSONResult struct {
	Added      []*EndpointSummary `json:"added"`
	Deleted    []*EndpointSummary `json:"deleted"`
	Deprecated []*EndpointSummary `json:"deprecated"`
	Modified   []*ModifiedSummary `json:"modified"`

	Breaking bool   `json:"breaking"`
	Message  string `json:"message"`
}

type ModifiedSummary

type ModifiedSummary struct {
	Old *OperationSummary `json:"old"`
	New *OperationSummary `json:"new"`

	Path        string `json:"path"`
	Method      string `json:"method"`
	Summary     string `json:"summary"`
	Description string `json:"description"`

	Breaking bool   `json:"breaking"`
	Message  string `json:"message"`

	ParametersSummary  *ParametersSummary  `json:"parameters"`
	RequestBodySummary *RequestBodySummary `json:"requestBody"`
	ResponsesSummary   *ResponsesSummary   `json:"responses"`
	SecuritySummary    *SecuritySummary    `json:"security"`
}

type OperationSummary

type OperationSummary struct{ openapi3.Operation }

type ParameterSummary

type ParameterSummary struct {
	Parameter, OldParameter, NewParameter *openapi3.Parameter `json:"-"`

	Name        string `json:"name"`
	In          string `json:"in"`
	Description string `json:"description"`
	Deprecated  bool   `json:"deprecated"` // TODO
	Breaking    bool   `json:"breaking"`
	Action      Action `json:"action"`
	Message     string `json:"message"`
}

type ParametersSummary

type ParametersSummary struct {
	Breaking bool                `json:"breaking"`
	Message  string              `json:"message"`
	Details  []*ParameterSummary `json:"details"`
}

type PropertiesSummary

type PropertiesSummary struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Action      Action `json:"action"`
	Breaking    bool   `json:"breaking"`
	Message     string `json:"message"`

	Nested []*PropertiesSummary `json:"properties"`

	Group string `json:"-"` // group that this property belongs to, e.g. items
}

type RequestBodySummary

type RequestBodySummary struct {
	Breaking bool   `json:"breaking"`
	Message  string `json:"message"`

	Description string `json:"description"`

	Details []*RequestBodySummaryDetail `json:"details"`
}

type RequestBodySummaryDetail

type RequestBodySummaryDetail struct {
	ReqBody, OldReqBody, NewReqBody *openapi3.RequestBody `json:"-"`

	Properties []*PropertiesSummary `json:"properties"`

	Breaking bool   `json:"breaking"`
	Action   Action `json:"action"`
	Message  string `json:"message"`
	Name     string `json:"name"`
}

type ResponseSummaryDetail

type ResponseSummaryDetail struct {
	Res *openapi3.Response `json:"-"`

	Description string               `json:"description"`
	Name        string               `json:"name"`
	Action      Action               `json:"action"`
	Breaking    bool                 `json:"breaking"`
	Message     string               `json:"message"`
	Properties  []*PropertiesSummary `json:"properties"`
}

type ResponsesSummary

type ResponsesSummary struct {
	Breaking bool                      `json:"breaking"`
	Message  string                    `json:"message"`
	Details  []*ResponsesSummaryDetail `json:"details"`
}

type ResponsesSummaryDetail

type ResponsesSummaryDetail struct {
	Res, OldRes, NewRes *openapi3.Response `json:"-"`

	Details []*ResponseSummaryDetail `json:"details"`

	Name        string `json:"name"` // status code
	Description string `json:"description"`
	Action      Action `json:"action"`
	Breaking    bool   `json:"breaking"`
	Message     string `json:"message"`
}

type Result

type Result struct {
	JSON     *JSONResult `json:"json,omitempty"`
	HTML     string      `json:"html,omitempty"`
	Markdown string      `json:"markdown,omitempty"`
	Text     string      `json:"text,omitempty"`
}

Result represents the result for a models.SpecDiff (SpecDiff.JSONResult)

type SecuritySummary

type SecuritySummary struct {
	Breaking bool                     `json:"breaking"`
	Message  string                   `json:"message"`
	Details  []*SecuritySummaryDetail `json:"details"`
}

type SecuritySummaryDetail

type SecuritySummaryDetail struct {
	SecReq, OldSecReq, NewSecReq *openapi3.SecurityRequirement `json:"-"`

	Breaking bool   `json:"breaking"`
	Name     string `json:"name"`
	Action   Action `json:"action"`
	Message  string `json:"message"`
}

type SummaryMessageBuilder

type SummaryMessageBuilder interface {
	// contains filtered or unexported methods
}

func NewMarkdownSummaryMessageBuilder

func NewMarkdownSummaryMessageBuilder() SummaryMessageBuilder

Jump to

Keyboard shortcuts

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