{"openapi":"3.0.0","paths":{"/categories":{"get":{"operationId":"CategoryController_findAll","parameters":[],"responses":{"200":{"description":"List of all categories.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}}}},"summary":"Get all categories","tags":["Categories"]}},"/categories/{id}":{"get":{"operationId":"CategoryController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Details of the category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"404":{"description":"Category not found."}},"summary":"Get a category by ID","tags":["Categories"]}},"/datasets":{"get":{"operationId":"DatasetController_findAllAccepted","parameters":[{"name":"title","required":false,"in":"query","description":"Filter by dataset title (partial match)","schema":{"type":"string"}},{"name":"categoryId","required":false,"in":"query","description":"Filter by category ID","schema":{"example":"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11","type":"string"}},{"name":"institutionId","required":false,"in":"query","description":"Filter by publisher institution ID","schema":{"example":"b0eebc99-9c0b-4ef8-bb6d-6bb9bd380a55","type":"string"}},{"name":"tags","required":false,"in":"query","description":"Filter by tags (comma-separated or array, matches datasets containing ALL specified tags)","schema":{"type":"array","items":{"type":"string"}}},{"name":"page","required":false,"in":"query","description":"Page number for pagination","schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page","schema":{"minimum":1,"default":20,"type":"number"}},{"name":"sortBy","required":false,"in":"query","description":"Field to sort public results by","schema":{"default":"submissionDate","example":"submissionDate","type":"string","enum":["title","submissionDate","lastUpdatedAt","reviewDate"]}},{"name":"sortOrder","required":false,"in":"query","description":"Sort order","schema":{"example":"DESC","type":"string","enum":["ASC","DESC"]}}],"responses":{"200":{"description":"A list of accepted datasets.","content":{"application/json":{"schema":{"properties":{"datasets":{"type":"array","items":{"$ref":"#/components/schemas/PublicDatasetResponseDto"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}}}}}}},"summary":"List all accepted datasets (public)","tags":["Datasets"]}},"/datasets/metrics":{"get":{"operationId":"DatasetController_getPublicMetrics","parameters":[],"responses":{"200":{"description":"Public dataset metrics.","content":{"application/json":{"schema":{"properties":{"total":{"type":"number"}}}}}}},"summary":"Get public accepted-dataset metrics","tags":["Datasets"]}},"/datasets/{id}":{"get":{"operationId":"DatasetController_findOneAccepted","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Dataset details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicDatasetResponseDto"}}}},"404":{"description":"Dataset not found or not accepted."}},"summary":"Get a specific accepted dataset by ID (public)","tags":["Datasets"]}},"/institutions":{"get":{"operationId":"InstitutionController_findVerifiedPublishers","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InstitutionSummaryDto"}}}}}},"summary":"List verified public-data publishers","tags":["Institutions"]}}},"info":{"title":"Uganda Open Data Platform · Public API","description":"Read-only access to accepted datasets, categories, and verified publishers. No authentication is required.","version":"1.0.0","contact":{}},"tags":[],"servers":[{"url":"https://uod-server.aistudio.ug","description":"Uganda Open Data Platform API"}],"components":{"schemas":{"InstitutionSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"logoUrl":{"type":"string","nullable":true},"websiteUrl":{"type":"string","nullable":true},"isVerified":{"type":"boolean"},"publishedDatasetCount":{"type":"number","description":"Number of accepted public datasets"},"latestPublicationAt":{"type":"string","format":"date-time","nullable":true,"description":"Latest accepted publication date"}},"required":["id","name","slug","description","isVerified","publishedDatasetCount"]},"PublicDatasetResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Dataset ID","example":"b1eebc99-9c0b-4ef8-bb6d-6bb9bd380a22"},"title":{"type":"string","description":"Public title of the dataset","example":"Hospital Locations in Kampala"},"description":{"type":"string","description":"Public dataset description"},"category":{"description":"Dataset category","allOf":[{"$ref":"#/components/schemas/Category"}]},"categoryId":{"type":"string","description":"Dataset category ID"},"institution":{"nullable":true,"description":"Verified publisher institution","allOf":[{"$ref":"#/components/schemas/Institution"}]},"institutionId":{"type":"string","nullable":true,"description":"Verified publisher institution ID"},"tags":{"description":"Searchable tags","type":"array","items":{"type":"string"}},"fileURL":{"type":"string","format":"uri","description":"Public URL for the dataset file"},"bannerUrl":{"type":"string","nullable":true,"description":"Optional public dataset banner URL"},"files":{"type":"array","items":{"$ref":"#/components/schemas/DatasetFileResponseDto"}},"status":{"type":"string","enum":["ACCEPTED"],"example":"ACCEPTED","description":"Public release status"},"submissionDate":{"type":"string","format":"date-time"},"lastUpdatedAt":{"type":"string","format":"date-time"},"reviewDate":{"type":"string","format":"date-time","nullable":true},"visibility":{"type":"string","enum":["PUBLIC","UNLISTED","PRIVATE"]},"accessPolicy":{"type":"string","enum":["OPEN","REGISTERED","REQUEST","INTERNAL"]},"licenseCode":{"type":"string","enum":["UNSPECIFIED","CC0_1_0","CC_BY_4_0","CC_BY_SA_4_0","ODBL_1_0","CUSTOM","VIEW_ONLY","ALL_RIGHTS_RESERVED"]},"customLicenseName":{"type":"object","nullable":true},"customLicenseUrl":{"type":"object","nullable":true},"customLicenseText":{"type":"object","nullable":true},"accessDurationDays":{"type":"object","nullable":true},"requestInstructions":{"type":"object","nullable":true},"licence":{"$ref":"#/components/schemas/DatasetLicenceResponseDto"},"currentUserAccess":{"$ref":"#/components/schemas/CurrentDatasetAccessDto"}},"required":["id","title","description","category","categoryId","fileURL","files","status","submissionDate","lastUpdatedAt","visibility","accessPolicy","licenseCode"]},"CurrentDatasetAccessDto":{"type":"object","properties":{"state":{"type":"string"},"canViewMetadata":{"type":"boolean"},"canPreview":{"type":"boolean"},"canDownload":{"type":"boolean"},"canUseApi":{"type":"boolean"},"canRequest":{"type":"boolean"},"expiresAt":{"type":"object","nullable":true}},"required":["state","canViewMetadata","canPreview","canDownload","canUseApi","canRequest"]},"DatasetLicenceResponseDto":{"type":"object","properties":{"code":{"type":"string","enum":["UNSPECIFIED","CC0_1_0","CC_BY_4_0","CC_BY_SA_4_0","ODBL_1_0","CUSTOM","VIEW_ONLY","ALL_RIGHTS_RESERVED"]},"name":{"type":"string"},"version":{"type":"string"},"url":{"type":"object","nullable":true},"open":{"type":"boolean"},"canDownload":{"type":"boolean"},"canUseApi":{"type":"boolean"},"canRedistribute":{"type":"boolean"},"canModify":{"type":"boolean"},"canUseCommercially":{"type":"boolean"},"attributionRequired":{"type":"boolean"},"customTerms":{"type":"object","nullable":true}},"required":["code","name","version","open","canDownload","canUseApi","canRedistribute","canModify","canUseCommercially","attributionRequired"]},"DatasetFileResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"originalName":{"type":"string","example":"district-population.csv"},"mimeType":{"type":"string","example":"text/csv"},"size":{"type":"number","description":"File size in bytes","example":24812},"isPrimary":{"type":"boolean","description":"Whether this is the default dataset resource"},"formatFamily":{"type":"string","example":"tabular"},"viewer":{"type":"string","example":"table"},"previewMode":{"type":"string","example":"rich"},"extension":{"type":"string","example":".csv"},"formatLabel":{"type":"string","example":"Delimited table"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","originalName","mimeType","size","isPrimary","formatFamily","viewer","previewMode","extension","formatLabel","createdAt"]},"Institution":{"type":"object","properties":{"id":{"type":"string","description":"Institution ID"},"name":{"type":"string","description":"Public institution name"},"slug":{"type":"string","description":"URL-safe institution identifier"},"description":{"type":"string","description":"Short public description"},"logoUrl":{"type":"string","nullable":true,"description":"Institution logo URL"},"websiteUrl":{"type":"string","nullable":true,"description":"Institution website URL"},"isVerified":{"type":"boolean","description":"Whether publisher identity is verified"},"createdAt":{"format":"date-time","type":"string","description":"Timestamp of institution creation"},"updatedAt":{"format":"date-time","type":"string","description":"Timestamp of institution update"}},"required":["id","name","slug","description","isVerified","createdAt","updatedAt"]},"Category":{"type":"object","properties":{"id":{"type":"string","description":"Category ID","example":"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"},"name":{"type":"string","description":"Name of the category","example":"Health Data"},"description":{"type":"string","description":"Detailed description of the category","example":"Datasets related to public health, medical records, etc."},"createdAt":{"format":"date-time","type":"string","description":"Timestamp of category creation"},"updatedAt":{"format":"date-time","type":"string","description":"Timestamp of last category update"}},"required":["id","name","description","createdAt","updatedAt"]}}}}