Skip to content
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

CLOUDP-236398: Add validation logic for paths #7

Merged
merged 10 commits into from
Mar 11, 2024

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Mar 8, 2024

Proposed changes

Jira ticket: CLOUDP-236398

This PR adds the logic to merge paths of two specs

./bin/openapicli merge -b test/data/base.json -e test/data/external.json -o test/data/FOAS.json                                                          

2024/03/08 17:38:48
Merged spec was saved in 'test/data/FOAS.json'.

Checklist

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

Further comments

I tested the command locally with the file under test/data and chcked that the FOAS.json contains all the paths

@andreaangiolillo andreaangiolillo marked this pull request as ready for review March 8, 2024 17:43
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner March 8, 2024 17:43
tools/cli/FOAS.json Outdated Show resolved Hide resolved
basePath string
outputPath string
externalPaths []string
}

func (o *Opts) Run(_ []string) error {
// To add in follow up PR: CLOUDP-225849
return o.saveFile([]byte("test"))
federated, err := o.Merger.MergeOpenAPISpecs(o.externalPaths)
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add unit tests or do we want to capture in another ticket?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

planning to add them in a follow-up PR where I add mocking

@andreaangiolillo andreaangiolillo requested review from blva and a team March 8, 2024 17:58
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't define the interfaces where they are implemented, define them where they are used

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressing this in the next PR

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

LGTM

@andreaangiolillo andreaangiolillo merged commit 3ed479c into main Mar 11, 2024
2 checks passed
@andreaangiolillo andreaangiolillo deleted the CLOUDP-236398_6 branch March 11, 2024 10:34
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