Skip to content

Conversation

@davidebriani
Copy link
Contributor

Add a --check option to run Mix tasks and compare the generated spec with a previously generated file.

This is useful for scenarios where a CI check is desirable to catch unwanted drifts from a validated OpenAPI spec: e.g. the OpenAPI spec is committed and reviewed, and should not change without additional review.

Fixes #617

Add a --check option to run Mix tasks and compare the generated spec
with a previously generated file.

This is useful for scenarios where a CI check is desirable to catch
unwanted drifts from a validated OpenAPI spec: e.g. the OpenAPI spec is
committed and reviewed, and should not change without additional review.

Fixes open-api-spex#617

Signed-off-by: Davide Briani <[email protected]>
@mbuhot mbuhot merged commit 56dcf23 into open-api-spex:master Jul 7, 2024
$ mix openapi.spec.json --spec PhoenixAppWeb.ApiSpec apispec.json
$ mix openapi.spec.json --spec PhoenixAppWeb.ApiSpec --pretty=true
$ mix openapi.spec.json --spec PhoenixAppWeb.ApiSpec --check=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small stylistic note: Boolean arga can be set to true with just --arg, looks a bit nicer than --arg=true

nathanalderson pushed a commit to Tango-Tango/open_api_spex that referenced this pull request Dec 20, 2024
…le (open-api-spex#618)

Add a --check option to run Mix tasks and compare the generated spec
with a previously generated file.

This is useful for scenarios where a CI check is desirable to catch
unwanted drifts from a validated OpenAPI spec: e.g. the OpenAPI spec is
committed and reviewed, and should not change without additional review.

Fixes open-api-spex#617

Signed-off-by: Davide Briani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --check flag to mix openapi.spec.json and mix openapi.spec.yaml

3 participants