Skip to content

Conversation

@blva
Copy link
Collaborator

@blva blva commented Mar 7, 2025

Proposed changes

Jira ticket: CLOUDP-302671

  • Add a filter command, to be executed after foas is merged
  • The command applies non-versioning filterings, clearing up any custom extensions: IPA exceptions, owner teams, and hides the endpoints for the given env if no version is provided
  • It apples versioning filtering if a version is provided

Testing

./bin/foascli filter -s ../../openapi/v2.json -o ../../openapi/v2.json --env prod

Result: 2dd3e79

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

Base automatically changed from filter-docs to main March 7, 2025 16:01
@blva blva changed the title CLOUDP-302671: Filter x-xgen data CLOUDP-302671: Add filter command that removes x-xgen extensions from OAS Mar 7, 2025
@blva blva marked this pull request as ready for review March 7, 2025 18:24
@blva blva requested a review from a team as a code owner March 7, 2025 18:24
@wtrocki
Copy link
Member

wtrocki commented Mar 7, 2025

Do you plan to enable filters for merges to main? Would we have dev branch affected?

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +91 to +92
Short: `Filter Open API specification removing hidden endpoints and extension metadata.
If a version is provided, versioning filters will also be applied.`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we define a flag with the name of the filter to apply? I am wondering a flag would help to clarify what filters will be applied to the spec

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about it, but since we don't have a use case I would rather only give the two options for now, to avoid generating several different specs with different filters applied

outputPath: "foas.html",
externalPaths: externalPaths,
basePath: "base.json",
format: "json",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
format: "json",
jsonFormat: "json",

@blva blva merged commit 72c2e20 into main Mar 10, 2025
11 checks passed
@blva blva deleted the CLOUDP-302671 branch March 10, 2025 12:51
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