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

APISpec.add_path overwrites paths #4

Closed
hello-josh opened this issue Apr 3, 2015 · 1 comment
Closed

APISpec.add_path overwrites paths #4

hello-josh opened this issue Apr 3, 2015 · 1 comment

Comments

@hello-josh
Copy link
Contributor

I was toying around with writing a wsgi middleware that used smore while fleshing out some ideas and noticed that smore.apispec.APISpec.add_path does a full replace via dict.update when adding a new path that matches an existing path. It ends up being a last one wins situation.

What do you think about storing the Path object in _paths and doing a recursive merge of all of its properties when calling add_path and then converting to dict when smore.apispec.APISpec.to_dict is called?

@sloria
Copy link
Member

sloria commented Apr 10, 2015

What do you think about storing the Path object in _paths and doing a recursive merge of all of its properties when calling add_path and then converting to dict when smore.apispec.APISpec.to_dict is called?

+1. I think that is a fine solution.

@sloria sloria closed this as completed in 7ad2cdd Apr 11, 2015
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

No branches or pull requests

2 participants