diff --git a/.github/workflows/validate-oas-files.yml b/.github/workflows/validate-oas-files.yml new file mode 100644 index 0000000..bb5f5ec --- /dev/null +++ b/.github/workflows/validate-oas-files.yml @@ -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 diff --git a/.github/workflows/version.yml b/.github/workflows/validate-version-label.yml similarity index 100% rename from .github/workflows/version.yml rename to .github/workflows/validate-version-label.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml deleted file mode 100644 index 8274b18..0000000 --- a/.github/workflows/validate.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Validate OAS Files - -on: [push] - -jobs: - discover-files: - name: Discover OpenAPI Files - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v3 - - name: Discover OpenAPI files - id: set-matrix - run: | - files=$(find openapi/ -name "*.yml" -o -name "*.yaml") - matrix_json=$(echo "$files" | jq -R -s -c ' - split("\n")[:-1] | - map(select(length > 0)) | - map({ - openapi_file: ., - filename: (. | split("/")[-1]) - }) - ') - echo "matrix=${matrix_json}" >> $GITHUB_OUTPUT - echo "Found files matrix: ${matrix_json}" - - validate-openapi: - name: Validate ${{ matrix.filename }} - needs: discover-files - runs-on: ubuntu-latest - strategy: - matrix: - include: ${{ fromJson(needs.discover-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 diff --git a/openapi/v20111101.yml b/openapi/v20111101.yml index 1390cb6..d46236f 100644 --- a/openapi/v20111101.yml +++ b/openapi/v20111101.yml @@ -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: