docs: sync API docs from website#60
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the OpenAPI documentation by adding three new query parameters—query, sort_by, and sort_order—and updating several source line references. The review feedback suggests enhancing these new parameters by adding descriptions and examples to improve documentation quality, and specifically recommends restricting sort_order to an enumeration of 'asc' and 'desc' for better validation.
| { | ||
| "name": "query", | ||
| "in": "query", | ||
| "required": false, | ||
| "schema": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "title": "Query" | ||
| } | ||
| }, | ||
| { | ||
| "name": "sort_by", | ||
| "in": "query", | ||
| "required": false, | ||
| "schema": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "title": "Sort By" | ||
| } | ||
| }, | ||
| { | ||
| "name": "sort_order", | ||
| "in": "query", | ||
| "required": false, | ||
| "schema": { | ||
| "type": "string", | ||
| "default": "asc", | ||
| "title": "Sort Order" | ||
| } | ||
| } |
There was a problem hiding this comment.
The new query parameters (query, sort_by, sort_order) lack descriptions and examples, which reduces the quality of the public API documentation. Additionally, sort_order should include an enum to restrict values to asc and desc. Providing these details ensures consistency with other well-documented endpoints in this schema and improves the developer experience for API consumers.
{
"name": "query",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Query",
"description": "Search query to filter providers by name or description."
},
"description": "Search query to filter providers by name or description.",
"example": "cloud"
},
{
"name": "sort_by",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Sort By",
"description": "Field to sort the results by (e.g., name, score)."
},
"description": "Field to sort the results by (e.g., name, score).",
"example": "name"
},
{
"name": "sort_order",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"asc",
"desc"
],
"default": "asc",
"title": "Sort Order",
"description": "Sort order for the results (asc or desc)."
},
"description": "Sort order for the results (asc or desc).",
"example": "asc"
}
Mirrors website-owned REST API, Cookbook, and OpenAPI docs after qveris-website release/test changed. Source run: https://github.com/WonderfulValley/qveris-website/actions/runs/26236637463.