Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- name: Build OpenAPI spec and events
run: nix develop --impure --command just build ${{github.ref_name}}
env:
GH_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
- name: Generate changelog
run: bash .github/scripts/generate-changelog.sh
Expand Down
4 changes: 3 additions & 1 deletion .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.797.0
speakeasyVersion: 1.804.0
sources:
stacks-source:
sourceNamespace: stacks-source
Expand Down Expand Up @@ -34,6 +34,8 @@ workflow:
modelNamespace: orchestration
- location: ./components/reconciliation.openapi.yaml
modelNamespace: reconciliation
- location: ./components/connectivity.openapi.yaml
modelNamespace: connectivity
- location: ./releases/base.yaml
overlays:
- location: ./releases/overlays/shared.overlay.yaml
Expand Down
2 changes: 2 additions & 0 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ sources:
modelNamespace: orchestration
- location: ./components/reconciliation.openapi.yaml
modelNamespace: reconciliation
- location: ./components/connectivity.openapi.yaml
modelNamespace: connectivity
- location: ./releases/base.yaml
overlays:
- location: ./releases/overlays/shared.overlay.yaml
Expand Down
8 changes: 6 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ SEARCH_VERSION := "v2.1.0"
ORCHESTRATION_VERSION := "v2.6.4"
RECONCILIATION_VERSION := "v2.5.0"
GATEWAY_VERSION := "v2.3.2"
# Connectivity API releases do not yet publish an OpenAPI asset.
CONNECTIVITY_VERSION := "main"

# Download all component OpenAPI specs from GitHub releases
# Download component OpenAPI specs from GitHub releases or source
download-specs:
mkdir -p components
gh api -H "Accept: application/vnd.github.raw+json" "repos/formancehq/connectivity/contents/misc/connectivity-api/openapi.yaml?ref={{ CONNECTIVITY_VERSION }}" > components/connectivity.openapi.yaml
wget -q https://github.com/formancehq/ledger/releases/download/{{ LEDGER_VERSION }}/openapi.yml -O components/ledger.openapi.yaml
wget -q https://github.com/formancehq/ledger/releases/download/{{ LEDGER_V2_VERSION }}/openapi.yaml -O components/ledger-v2.openapi.yaml
wget -q https://github.com/formancehq/payments/releases/download/{{ PAYMENTS_VERSION }}/openapi.yaml -O components/payments.openapi.yaml
Expand All @@ -26,6 +29,7 @@ download-specs:

# Prepend API path prefix to each component spec
prepend-paths: download-specs
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/connectivity" + .key) | from_entries) | (.paths[] | .. | select(has("tags")).tags) = ["connectivity.v1"] | .paths."/api/connectivity/_info".get.operationId = "connectivityInfo"' components/connectivity.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/auth" + .key) | from_entries)' components/auth.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/ledger" + .key) | from_entries) | (.paths[] | .. | select(has("tags")).tags) = ["ledger.v3"]' components/ledger.openapi.yaml
yq -i '.paths |= (to_entries | map(select(.key == "/*").key = "/api/ledger" + .key) | from_entries) | del(.paths."/api/ledger/_info")' components/ledger-v2.openapi.yaml
Expand Down Expand Up @@ -70,7 +74,7 @@ validate-openapi:
jq -e '.paths["/api/ledger/v2"] != null and .paths["/api/ledger/v3/"] != null' releases/build/generate.json >/dev/null
# Composition cleanups must remain applied when component specs change.
jq -e '.components.schemas.auth_Scope == null and .components.schemas.auth_ScopeOptions == null' releases/build/generate.json >/dev/null
jq -e '[.. | objects | select(.enum? != null) | .enum | select(length != (unique | length))] | length == 0' releases/build/generate.json >/dev/null
jq -e '[.. | objects | select(.enum? | type == "array") | .enum | select(length != (unique | length))] | length == 0' releases/build/generate.json >/dev/null
Comment thread
Dav-14 marked this conversation as resolved.

# Generate event schemas
generate-events:
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
default = pkgs.mkShell {
packages = [
pkgs.jq
pkgs.gh
pkgs.just
pkgs.nodejs_22
pkgs.wget
Expand Down
4 changes: 4 additions & 0 deletions releases/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ servers:
- us-east-1

tags:
- name: connectivity.v1
- name: ledger.v1
- name: ledger.v2
- name: ledger.v3
Expand All @@ -64,6 +65,9 @@ components:
scopes: {}

x-tagGroups:
- name: Connectivity
tags:
- connectivity.v1
- name: Auth
tags:
- auth.v1
Expand Down
Loading