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

Adds support for template yml files in docstring #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

s1113950
Copy link

@s1113950 s1113950 commented Nov 29, 2016

Fixes #39

This converts any included yml file into a template that then gets included in docstrings if not overridden by what's already in the docstring.

It assumes for lists of dicts (like in the case of multiple parameters values) that the dicts are unique by their name attribute, in accordance with the swagger specs.

Any comments are welcome!

The new put doc:

"put": {
        "description": "<br/>",
        "parameters": [
          {
            "description": "filename. this overrides what's in the .yml file",
            "in": "formData",
            "name": "filename",
            "required": false,
            "type": "string"
          },
          {
            "description": "username",
            "in": "formData",
            "name": "username",
            "required": false,
            "type": "file"
          },
          {
            "description": "password",
            "in": "formData",
            "name": "password",
            "required": false,
            "type": "file"
          },
          {
            "in": "body",
            "name": "body",
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "this description stays"
          },
          "204": {
            "description": "User updated"
          }
        },
        "summary": "Update a user, this summary stays",
        "tags": [
          "user_update"
        ]
      }

The merge function is kinda complicated so I added a bunch of comments throughout explaining how the merging happens!

Also sorry about the weird branch name, messed that up accidentally 😛

@s1113950
Copy link
Author

s1113950 commented Dec 9, 2016

This is ready for review for whoever wants to check it out 😄

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.

1 participant