-
Notifications
You must be signed in to change notification settings - Fork 0
Add examples in flask - restplus models #27
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
Conversation
time_tracker_api/api.py
Outdated
| title='Creator', | ||
| max_length=64, | ||
| description='User that created it', | ||
| example=faker.uuid4() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add trailing comas
| title='Project', | ||
| max_length=64, | ||
| description='The id of the selected project', | ||
| example=faker.uuid4() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the ids that are stored in the database are going to be integers because that is how SQL databases do it. So let's keep the ids as random integers of 4 digits maximum, at least for now. Later when we start doing migrations to uuid we do the change, but the representation has to be truth to real.
| title='Is it running?', | ||
| description='Whether this time entry is currently running or not' | ||
| description='Whether this time entry is currently running or not', | ||
| example=faker.boolean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, running has to be true if the end_date has no value. I think that end_date has to have a value or not.
Examples have been added to make the swagger docs more expressive, with the help of the library Faker.
Check #26 for details.
Also I included two fixes in code such as :
uidtoidfor consistency