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

Add partial substitution of docstrings -- expansion of .yml file support #39

Open
s1113950 opened this issue Nov 28, 2016 · 5 comments
Open

Comments

@s1113950
Copy link

I was curious if there will be support for doing a partial substitution of a doc string instead of an entire replace if you specify a .yml file?

What I'm trying to do is something like:

def my_func():
    """
    My func title

    special text for my func

    swagger_from_file: file.yml

    more special text
    """

And have the special text for my func and more special text be represented as well. Currently the whole doc string gets replaced by what's in the file.yml file. This is especially useful when there's a bunch of endpoints with mostly common functionality but differ by a few parameters for example.

I'd be happy to make a PR for this if you see it as a worthy addition! 😄

@atlithorn
Copy link
Contributor

So basically a merge of swagger found in docstrings and swagger_from_file?
Sounds very worthy, I assume that inline swagger would take preference, right?

@s1113950
Copy link
Author

Yep! It would be like the full doc = text here + {yml_file_data} + text here.

@s1113950
Copy link
Author

Oh wait, you're talking about the yml file being like a template that can be overridden by the inline swagger? I can do that as well!

@atlithorn
Copy link
Contributor

Yes - I think that would be clearer and more useful than string concatenation.

@s1113950
Copy link
Author

Agreed!

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