Enhance Tender Search API with Advanced Filtering and Documentation Updates
- Updated the Tender Search API to include additional query parameters for enhanced filtering capabilities, such as currency, deadline ranges, publication dates, languages, and buyer organization ID. - Changed existing query parameter types from integer to string for better flexibility in search queries. - Improved Swagger and YAML documentation to reflect the new parameters and their descriptions, ensuring clarity for API consumers. - Updated handler comments to align with the new query structure, providing comprehensive details for each parameter. - Enhanced response structures to return a well-defined SearchResponse, improving the overall API usability and documentation consistency.
This commit is contained in:
+221
-36
@@ -5370,21 +5370,51 @@ const docTemplate = `{
|
||||
"summary": "Get public tenders",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items per page (default: 20, max: 50)",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items to skip (default: 0)",
|
||||
"name": "offset",
|
||||
"type": "string",
|
||||
"description": "Search query for title and description",
|
||||
"name": "q",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by country code",
|
||||
"name": "country_code",
|
||||
"description": "Filter by notice type code",
|
||||
"name": "notice_type",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by procurement type code",
|
||||
"name": "procurement_type",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by country codes (comma-separated)",
|
||||
"name": "country_codes",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by status (comma-separated)",
|
||||
"name": "status",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by source (comma-separated)",
|
||||
"name": "source",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
@@ -5400,15 +5430,73 @@ const docTemplate = `{
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication from",
|
||||
"name": "publication_from",
|
||||
"type": "string",
|
||||
"description": "Filter by currency",
|
||||
"name": "currency",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication to",
|
||||
"name": "publication_to",
|
||||
"description": "Deadline from",
|
||||
"name": "deadline_from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Deadline to",
|
||||
"name": "deadline_to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication date from",
|
||||
"name": "publication_date_from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication date to",
|
||||
"name": "publication_date_to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by languages (comma-separated)",
|
||||
"name": "languages",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by buyer organization ID",
|
||||
"name": "buyer_organization_id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items per page (default: 20, max: 100)",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items to skip (default: 0)",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort by field",
|
||||
"name": "sort_by",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort order (asc or desc)",
|
||||
"name": "sort_order",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
@@ -5424,8 +5512,7 @@ const docTemplate = `{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
"$ref": "#/definitions/tender.SearchResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5523,21 +5610,51 @@ const docTemplate = `{
|
||||
"summary": "Get public tenders",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items per page (default: 20, max: 50)",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items to skip (default: 0)",
|
||||
"name": "offset",
|
||||
"type": "string",
|
||||
"description": "Search query for title and description",
|
||||
"name": "q",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by country code",
|
||||
"name": "country_code",
|
||||
"description": "Filter by notice type code",
|
||||
"name": "notice_type",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by procurement type code",
|
||||
"name": "procurement_type",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by country codes (comma-separated)",
|
||||
"name": "country_codes",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by status (comma-separated)",
|
||||
"name": "status",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by source (comma-separated)",
|
||||
"name": "source",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
@@ -5553,15 +5670,73 @@ const docTemplate = `{
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication from",
|
||||
"name": "publication_from",
|
||||
"type": "string",
|
||||
"description": "Filter by currency",
|
||||
"name": "currency",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication to",
|
||||
"name": "publication_to",
|
||||
"description": "Deadline from",
|
||||
"name": "deadline_from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Deadline to",
|
||||
"name": "deadline_to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication date from",
|
||||
"name": "publication_date_from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"description": "Publication date to",
|
||||
"name": "publication_date_to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Filter by languages (comma-separated)",
|
||||
"name": "languages",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Filter by buyer organization ID",
|
||||
"name": "buyer_organization_id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items per page (default: 20, max: 100)",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Number of items to skip (default: 0)",
|
||||
"name": "offset",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort by field",
|
||||
"name": "sort_by",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Sort order (asc or desc)",
|
||||
"name": "sort_order",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
@@ -5577,8 +5752,7 @@ const docTemplate = `{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
"$ref": "#/definitions/tender.SearchResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6509,6 +6683,17 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"tender.SearchResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"tenders": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/tender.TenderResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tender.TenderResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user