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
54 changes: 54 additions & 0 deletions .github/workflows/validate-oas-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Validate OAS Files

on: [pull_request]

jobs:
discover-changed-files:
name: Discover Changed OpenAPI Files
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
has_changes: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
- name: Check for changed OAS files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
openapi/**/*.yml
openapi/**/*.yaml
- name: Build matrix from changed files
id: set-matrix
if: steps.changed-files.outputs.any_changed == 'true'
run: |
matrix_json=$(echo '${{ steps.changed-files.outputs.all_changed_files }}' | jq -R -s -c '
split(" ") |
map(select(length > 0)) |
map({
openapi_file: .,
filename: (. | split("/")[-1])
})
')
echo "matrix=${matrix_json}" >> $GITHUB_OUTPUT
echo "Changed files matrix: ${matrix_json}"

validate-openapi:
name: Validate ${{ matrix.filename }}
needs: discover-changed-files
if: needs.discover-changed-files.outputs.has_changes == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(needs.discover-changed-files.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Validate Schema for ${{ matrix.openapi_file }}
uses: thiyagu06/openapi-validator-action@v1
with:
filepath: ${{ matrix.openapi_file }}
- name: Validate YAML for ${{ matrix.openapi_file }}
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: ${{ matrix.openapi_file }}
config_file: .yamllint.yml
45 changes: 0 additions & 45 deletions .github/workflows/validate.yml

This file was deleted.

1 change: 1 addition & 0 deletions openapi/v20111101.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ info:
The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.

Just getting started? See our [use case guides](/use-cases/).
Test
title: MX Platform API
version: '20111101'
servers:
Expand Down