flasgger/flasgger

swag_from does not accept pathlib.Path objects as path specification

Open

#251 opened on Oct 9, 2018

View on GitHub
 (2 comments) (1 reaction) (0 assignees)Python (500 forks)batch import
enhancementhacktoberfesthelp wanted

Repository metrics

Stars
 (3,435 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I think it would be nice if the swag_from decorator would accept pathlib.Path objects as this makes the paths os independent. Thus instead of:

@swag_from("swagger/version.yaml", endpoint='version')
def get(self):
....

I rather use:

@swag_from(Path("swagger/version.yaml"), endpoint='version')
def get(self):
....

I now have to wrap Path("swagger/version.yaml") into str()

Contributor guide