Dagger
Search

openapi-changes

Discover what changed between two OpenAPI specs, or a single spec over time.

Supports OpenAPI 3.1, 3.0 and Swagger

Installation

dagger install github.com/sagikazarmark/daggerverse/openapi-changes@f1b7c05c44807bd8399ee67a81618cdf7453f252

Entrypoint

Return Type
OpenapiChanges !
Arguments
NameTypeDefault ValueDescription
versionString -Version (image tag) to use from the official image repository as a base container.
containerContainer -Custom container to use as a base container.
noStyleBoolean -Disable all color output and all terminal styling (useful for CI/CD).
Example
func (m *myModule) example() *OpenapiChanges  {
	return dag.
			OpenapiChanges()
}

Types

OpenapiChanges 🔗

local() 🔗

Check for changes in a local Git repository.

Return Type
OpenapiChangesRun !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-The Git repository containing the OpenAPI specs.
specString !-Path to the OpenAPI spec file.
noStyleBoolean -Disable all color output and all terminal styling (useful for CI/CD).
topBoolean -Only show the latest changes (the last git revision against HEAD).
limitInteger -Limit the number of changes to show when using git.
baseString -Base URL or Base working directory to use for relative references.
Example
func (m *myModule) example(source *Directory, spec string) *OpenapiChangesRun  {
	return dag.
			OpenapiChanges().
			Local(source, spec)
}

remote() 🔗

Check for changes in a remote Git repository. (Currently only supports GitHub)

Return Type
OpenapiChangesRun !
Arguments
NameTypeDefault ValueDescription
urlString !-The URL of the OpenAPI spec file.
noStyleBoolean -Disable all color output and all terminal styling (useful for CI/CD).
topBoolean -Only show the latest changes (the last git revision against HEAD).
limitInteger -Limit the number of changes to show when using git.
baseString -Base URL or Base working directory to use for relative references.
Example
func (m *myModule) example(url string) *OpenapiChangesRun  {
	return dag.
			OpenapiChanges().
			Remote(url)
}

diff() 🔗

Compare two OpenAPI specs.

Return Type
OpenapiChangesRun !
Arguments
NameTypeDefault ValueDescription
oldFile !-The old OpenAPI spec file.
newFile !-The new OpenAPI spec file.
sourceDirectory -Optional source directory to use for relative references.
noStyleBoolean -Disable all color output and all terminal styling (useful for CI/CD).
baseString -Base URL or Base working directory to use for relative references.
Example
func (m *myModule) example(old *File, new *File) *OpenapiChangesRun  {
	return dag.
			OpenapiChanges().
			Diff(old, new)
}

OpenapiChangesRun 🔗

summary() 🔗

Return a summary of the changes.

See https://pb33f.io/openapi-changes/summary/ for more information.

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, old *File, new *File) string  {
	return dag.
			OpenapiChanges().
			Diff(old, new).
			Summary(ctx)
}

markdown() 🔗

Return a summary of the changes in Markdown format.

See https://pb33f.io/openapi-changes/summary/ for more information.

Return Type
File !
Example
func (m *myModule) example(old *File, new *File) *File  {
	return dag.
			OpenapiChanges().
			Diff(old, new).
			Markdown()
}

json() 🔗

Return a JSON report of the changes.

See https://pb33f.io/openapi-changes/report/ for more information.

Return Type
File !
Example
func (m *myModule) example(old *File, new *File) *File  {
	return dag.
			OpenapiChanges().
			Diff(old, new).
			Json()
}

html() 🔗

Return a HTML report of the changes.

See https://pb33f.io/openapi-changes/html-report/ for more information.

Return Type
OpenapiChangesHtmlReport !
Example
func (m *myModule) example(old *File, new *File) *OpenapiChangesHtmlReport  {
	return dag.
			OpenapiChanges().
			Diff(old, new).
			Html()
}

OpenapiChangesHtmlReport 🔗

file() 🔗

Return Type
File !
Example
func (m *myModule) example(old *File, new *File) *File  {
	return dag.
			OpenapiChanges().
			Diff(old, new).
			Html().
			File()
}

serve() 🔗

Serve the HTML report on a local server.

Return Type
Service !
Arguments
NameTypeDefault ValueDescription
portInteger 8080The port to serve the HTML report on.
Example
func (m *myModule) example(old *File, new *File) *Service  {
	return dag.
			OpenapiChanges().
			Diff(old, new).
			Html().
			Serve()
}