Skip to content

feat: publish JSON files alongside specs + consolidate request bodies#29

Merged
mkurapov merged 9 commits into
mainfrom
max/rop-39
May 27, 2026
Merged

feat: publish JSON files alongside specs + consolidate request bodies#29
mkurapov merged 9 commits into
mainfrom
max/rop-39

Conversation

@mkurapov
Copy link
Copy Markdown
Contributor

@mkurapov mkurapov commented May 20, 2026

Context

In order to help the Open Payments implementations (in this case, Rafiki) validate the request & responses in the API, it is easier to do so using the JSON files. This PR adds a command to generate JSON files from the source-of-truth OpenAPI yaml files.

In addition to the above, this PR consolidates the request bodies of operations (like create incoming payment) into separate schemas in components.schemas. This allows for easier targeting of schemas when doing request validation in the API implementation.

Also, given that we would use redocly cli tool for the yaml to json conversion, this PR updates the linting command to also use redocly, consolidating our tooling (and removing spectral)

Related to RV2-55

@mkurapov mkurapov changed the title feat: move POST request bodies into separate components.schemas feat: publish JSON files alongside specs May 20, 2026
@mkurapov mkurapov changed the title feat: publish JSON files alongside specs feat: publish JSON files alongside specs + consolidate request bodies May 20, 2026
- name: Check if generated JSON files are up to date
run: |
pnpm generate:json
git diff --exit-code json/ No newline at end of file
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a manual process to generate the files, but because its a small command/we don't expect a huge number of changes, I thought it was better (simpler) than some automated commit hook or CI action that commits to the PR branch.

Comment thread package.json
"format": "prettier --write .",
"lint": "prettier --check .",
"lint:openapi": "spectral lint openapi/*"
"lint:openapi": "redocly lint openapi/* --lint-config error --format=stylish",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since we are already importing redocly, we can use its linting feature without having a separate spectral package

@mkurapov
Copy link
Copy Markdown
Contributor Author

Actions are down :(

https://www.githubstatus.com/incidents/gnftqj9htp0g

@mkurapov mkurapov marked this pull request as ready for review May 26, 2026 11:22
Copy link
Copy Markdown
Member

@raducristianpopa raducristianpopa left a comment

Choose a reason for hiding this comment

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

LGTM!

@mkurapov mkurapov merged commit 0ad3a8e into main May 27, 2026
5 checks passed
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.

3 participants