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

feat: merge path #91

Merged
merged 3 commits into from
Nov 19, 2022
Merged

feat: merge path #91

merged 3 commits into from
Nov 19, 2022

Conversation

MaurerKrisztian
Copy link
Contributor

Enable to merge paths.

doc.addPath('/users', {
  post: {...}
});

doc.mergePath('/users', {
  get: {...}
});

doc.mergePath('/users', {
  delete: {...}
});

// didn't overwrite "/users" as the "addPath" does, merging with the existing ones
/** result
{
  post: {...}
  get: {...}
  delete: {...}
}

*/

@pjmolina
Copy link
Contributor

Hi. Thanks for the PR @MaurerKrisztian
Can be implement addPath directly in the way you implemented it? I think so.
That way it will not introduce a new method: no need for the user to know if the the path was already inserted or not.
A test for it would be super-nice also to ensure the semantics are preserved.

@MaurerKrisztian
Copy link
Contributor Author

Hi @pjmolina, I didn't want to break something that's why I implemented it as a separate method. I added the requested changes. Hope you like it.

@pjmolina
Copy link
Contributor

Superb! Looks great. Thank you and merging!

@pjmolina pjmolina merged commit 3b0c6ee into metadevpro:master Nov 19, 2022
@pjmolina
Copy link
Contributor

Thank you again @MaurerKrisztian. Your fix is now published on openapi3-ts@3.1.2.

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.

None yet

2 participants