Skip to content

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.

2 participants