-
Notifications
You must be signed in to change notification settings - Fork 23
docs: added documentation to all API endpoint routes so far #75
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
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 response documentation in the following manner:
@router.get(
"/list",
summary="Get all teams",
response_model=list[Team_Pydantic],
response_description="""Returns a complete list of registered teams.
Example response:
```json
[
{
"id": 1,
"name": "Team Alpha",
"coins": 100,
"points": 250
}
]
```
""",
)
Ensure the response_model
field has data and move technical description to response_description or remove altogether.
created new file `response_models.py` in `src/pwncore/routes/ctf` used for API endpoint documentation for functions that start/stop/stopall docker containers in `start.py` file
merge lugvitc master branch to my branch for documentation
@ThEditor @KreativeThinker how can i fix this tox build check failing?? |
Don't worry about that |
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.
summary
should be removed
response_description
should only contain specifics like message codes. No need to put it in markdown/json format
I reckon we shud keep response_description for all in very short concise format, instead of removing it |
i think its best not to remove response_description, u can understand what the endpoint does just from reading the source code also removed summary as requested
Merge with lugvitc:docs for now as more changes are incoming. We will update there. |
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.
response_description
field should only contain specific edge cases or error codes. No need to have other text.
Once changes are made, create a new PR to lugvitc/pwncore:docs
Use this instead:
|
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.
all Pydantic response models that use the BaseModel
pydantic model are moved to one common folder
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.
Just delete wherever mentioned and make PR to pwncore:docs
No description provided.