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@322e31f8656ea8f805091302d52c1bead3114bd8
Entrypoint
Return Type
OpenapiChanges !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | - | Version (image tag) to use from the official image repository as a base container. |
container | Container | - | Custom container to use as a base container. |
noStyle | Boolean | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | The Git repository containing the OpenAPI specs. |
spec | String ! | - | Path to the OpenAPI spec file. |
noStyle | Boolean | - | Disable all color output and all terminal styling (useful for CI/CD). |
top | Boolean | - | Only show the latest changes (the last git revision against HEAD). |
limit | Integer | - | Limit the number of changes to show when using git. |
base | String | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The URL of the OpenAPI spec file. |
noStyle | Boolean | - | Disable all color output and all terminal styling (useful for CI/CD). |
top | Boolean | - | Only show the latest changes (the last git revision against HEAD). |
limit | Integer | - | Limit the number of changes to show when using git. |
base | String | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
old | File ! | - | The old OpenAPI spec file. |
new | File ! | - | The new OpenAPI spec file. |
source | Directory | - | Optional source directory to use for relative references. |
noStyle | Boolean | - | Disable all color output and all terminal styling (useful for CI/CD). |
base | String | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
port | Integer | 8080 | The 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()
}