Skip to content

Adds a script to list out duplicate schema definitions in OpenAPI spec files #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cbnsndwch
Copy link

Tool: List duplicate OpenAPI schema definitions across files

📋 Description

This PR adds a TypeScript script that scans the repository for duplicate OpenAPI/Swagger schema definitions across all .json files. The script helps identify schemas with the same name defined in multiple files, making it easier for the team to extract and centralize shared definitions. This improves maintainability and reduces duplication in our API documentation.

  • Bug fix
  • New documentation
  • Update to existing docs
  • Other (please describe):
    Adds a developer tool for codebase maintenance

🧪 Related Issues

📝 Checklist

  • I’ve tested my changes locally (if applicable).
  • I’ve added sufficient documentation.
  • I’ve reviewed existing open PRs for potential conflicts.
  • I’ve followed the repository's contribution guidelines.

💬 Additional Comments

The script is intended for developer use and can be executed from the root of the repo by running the following command:

npx tsx ./.tools/src/find-duplicate-schemas.ts

It will print a map of duplicate schema definition names and the files containing them. Please see the log attached to the linked issue for an output example

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Warning Infrastructure as Code high 31   medium 21   low 6219   info 2461 View in Orca
Passed Passed SAST high 0   medium 3   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca
🛡️ The following IaC misconfigurations have been detected
NAME FILE
low Response Code Missing (v3) ...ns/associations.json View in code
low Response Code Missing (v3) ...ndars/calendars.json View in code
low Response Code Missing (v3) ...ndars/calendars.json View in code
low Response Code Missing (v3) ...ndars/calendars.json View in code
low Response Code Missing (v3) ...ndars/calendars.json View in code
low Response Code Missing (v3) ...s/custom-fields.json View in code
low Response Code Missing (v3) ...us/custom-menus.json View in code
low Response Code Missing (v3) ...l-isv/email-isv.json View in code
low Response Code Missing (v3) emails/emails.json View in code
low Response Code Missing (v3) ...voices/invoices.json View in code
low Response Code Missing (v3) ...voices/invoices.json View in code
low Response Code Missing (v3) ...voices/invoices.json View in code
low Response Code Missing (v3) ...voices/invoices.json View in code
low Response Code Missing (v3) ...voices/invoices.json View in code
low Response Code Missing (v3) links/links.json View in code
low Response Code Missing (v3) ...tions/locations.json View in code
low Response Code Missing (v3) ...tions/locations.json View in code
low Response Code Missing (v3) ...ace/marketplace.json View in code
low Response Code Missing (v3) ...ace/marketplace.json View in code
low Response Code Missing (v3) ...s/opportunities.json View in code
low Response Code Missing (v3) ...s/opportunities.json View in code
low Response Code Missing (v3) ...yments/payments.json View in code
low Response Code Missing (v3) ...yments/payments.json View in code
low Response Code Missing (v3) ...l-media-posting.json View in code
low Response Code Missing (v3) surveys/surveys.json View in code
... ... ... ...
🛡️ The following SAST misconfigurations have been detected
NAME FILE
medium Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks ...duplicate-schemas.ts View in code
medium Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks ...duplicate-schemas.ts View in code
medium Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks ...duplicate-schemas.ts View in code

Note: The scan should have failed if no policies were configured in warn-only mode.

@gauravkanted-ghl gauravkanted-ghl requested a review from a team as a code owner June 9, 2025 16:40
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.

1 participant