forked from koala73/worldmonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplacementService.openapi.json
More file actions
1 lines (1 loc) · 10.9 KB
/
DisplacementService.openapi.json
File metadata and controls
1 lines (1 loc) · 10.9 KB
1
{"components":{"schemas":{"CountryDisplacement":{"description":"CountryDisplacement represents displacement metrics for a single country.","properties":{"asylumSeekers":{"description":"Asylum seekers from this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"code":{"description":"ISO 3166-1 alpha-2 country code.","minLength":1,"type":"string"},"hostAsylumSeekers":{"description":"Asylum seekers hosted by this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"hostRefugees":{"description":"Refugees hosted by this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"hostTotal":{"description":"Total persons hosted by this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"idps":{"description":"Internally displaced persons within this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"location":{"$ref":"#/components/schemas/GeoCoordinates"},"name":{"description":"Country name.","type":"string"},"refugees":{"description":"Refugees originating from this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"stateless":{"description":"Stateless persons associated with this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"totalDisplaced":{"description":"Total displaced from this country.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"}},"required":["code"],"type":"object"},"CountryPopulationEntry":{"description":"CountryPopulationEntry represents a country with population data.","properties":{"code":{"description":"ISO 3166-1 alpha-3 country code.","type":"string"},"densityPerKm2":{"description":"Population density per square kilometer.","format":"int32","type":"integer"},"name":{"description":"Country name.","type":"string"},"population":{"description":"Total population.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"}},"type":"object"},"DisplacementFlow":{"description":"DisplacementFlow represents a refugee movement corridor between two countries.","properties":{"asylumCode":{"description":"ISO 3166-1 alpha-2 code of the asylum country.","minLength":1,"type":"string"},"asylumLocation":{"$ref":"#/components/schemas/GeoCoordinates"},"asylumName":{"description":"Asylum country name.","type":"string"},"originCode":{"description":"ISO 3166-1 alpha-2 code of the origin country.","minLength":1,"type":"string"},"originLocation":{"$ref":"#/components/schemas/GeoCoordinates"},"originName":{"description":"Origin country name.","type":"string"},"refugees":{"description":"Number of refugees in this flow.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"}},"required":["originCode","asylumCode"],"type":"object"},"DisplacementSummary":{"description":"DisplacementSummary represents a global overview of displacement data from UNHCR.","properties":{"countries":{"items":{"$ref":"#/components/schemas/CountryDisplacement"},"type":"array"},"globalTotals":{"$ref":"#/components/schemas/GlobalDisplacementTotals"},"topFlows":{"items":{"$ref":"#/components/schemas/DisplacementFlow"},"type":"array"},"year":{"description":"Data year.","format":"int32","type":"integer"}},"type":"object"},"Error":{"description":"Error is returned when a handler encounters an error. It contains a simple error message that the developer can customize.","properties":{"message":{"description":"Error message (e.g., 'user not found', 'database connection failed')","type":"string"}},"type":"object"},"ExposureResult":{"description":"ExposureResult contains the population exposure estimate.","properties":{"densityPerKm2":{"description":"Population density used for the estimate.","format":"int32","type":"integer"},"exposedPopulation":{"description":"Estimated exposed population.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"exposureRadiusKm":{"description":"Radius used for the estimate in km.","format":"double","type":"number"},"nearestCountry":{"description":"ISO3 code of nearest priority country.","type":"string"}},"type":"object"},"FieldViolation":{"description":"FieldViolation describes a single validation error for a specific field.","properties":{"description":{"description":"Human-readable description of the validation violation (e.g., 'must be a valid email address', 'required field missing')","type":"string"},"field":{"description":"The field path that failed validation (e.g., 'user.email' for nested fields). For header validation, this will be the header name (e.g., 'X-API-Key')","type":"string"}},"required":["field","description"],"type":"object"},"GeoCoordinates":{"description":"GeoCoordinates represents a geographic location using WGS84 coordinates.","properties":{"latitude":{"description":"Latitude in decimal degrees (-90 to 90).","format":"double","maximum":90,"minimum":-90,"type":"number"},"longitude":{"description":"Longitude in decimal degrees (-180 to 180).","format":"double","maximum":180,"minimum":-180,"type":"number"}},"type":"object"},"GetDisplacementSummaryRequest":{"description":"GetDisplacementSummaryRequest specifies parameters for retrieving displacement data.","properties":{"countryLimit":{"description":"Maximum number of country entries to return.","format":"int32","minimum":0,"type":"integer"},"flowLimit":{"description":"Maximum number of displacement flows to return.","format":"int32","minimum":0,"type":"integer"},"year":{"description":"Data year to retrieve (e.g., 2023). Uses latest available if zero.","format":"int32","minimum":0,"type":"integer"}},"type":"object"},"GetDisplacementSummaryResponse":{"description":"GetDisplacementSummaryResponse contains the global displacement summary.","properties":{"summary":{"$ref":"#/components/schemas/DisplacementSummary"}},"type":"object"},"GetPopulationExposureRequest":{"description":"GetPopulationExposureRequest supports two modes:\n - countries mode (default): returns the priority countries list\n - exposure mode: estimates population within a radius of a point","properties":{"lat":{"description":"Latitude (required for exposure mode).","format":"double","maximum":90,"minimum":-90,"type":"number"},"lon":{"description":"Longitude (required for exposure mode).","format":"double","maximum":180,"minimum":-180,"type":"number"},"mode":{"description":"Mode: \"countries\" (default) or \"exposure\".","type":"string"},"radius":{"description":"Radius in km (required for exposure mode, defaults to 50).","format":"double","minimum":0,"type":"number"}},"type":"object"},"GetPopulationExposureResponse":{"description":"GetPopulationExposureResponse returns either a countries list or an exposure estimate.","properties":{"countries":{"items":{"$ref":"#/components/schemas/CountryPopulationEntry"},"type":"array"},"exposure":{"$ref":"#/components/schemas/ExposureResult"},"success":{"description":"True if the request succeeded.","type":"boolean"}},"type":"object"},"GlobalDisplacementTotals":{"description":"GlobalDisplacementTotals represents worldwide displacement figures.","properties":{"asylumSeekers":{"description":"Total asylum seekers worldwide.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","minimum":0,"type":"integer"},"idps":{"description":"Total internally displaced persons worldwide.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","minimum":0,"type":"integer"},"refugees":{"description":"Total recognized refugees worldwide.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","minimum":0,"type":"integer"},"stateless":{"description":"Total stateless persons worldwide.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","minimum":0,"type":"integer"},"total":{"description":"Grand total of displaced persons.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","minimum":0,"type":"integer"}},"type":"object"},"ValidationError":{"description":"ValidationError is returned when request validation fails. It contains a list of field violations describing what went wrong.","properties":{"violations":{"description":"List of validation violations","items":{"$ref":"#/components/schemas/FieldViolation"},"type":"array"}},"required":["violations"],"type":"object"}}},"info":{"title":"DisplacementService API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/displacement/v1/get-displacement-summary":{"get":{"description":"GetDisplacementSummary retrieves global refugee and IDP statistics from UNHCR.","operationId":"GetDisplacementSummary","parameters":[{"description":"Data year to retrieve (e.g., 2023). Uses latest available if zero.","in":"query","name":"year","required":false,"schema":{"format":"int32","type":"integer"}},{"description":"Maximum number of country entries to return.","in":"query","name":"country_limit","required":false,"schema":{"format":"int32","type":"integer"}},{"description":"Maximum number of displacement flows to return.","in":"query","name":"flow_limit","required":false,"schema":{"format":"int32","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDisplacementSummaryResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"GetDisplacementSummary","tags":["DisplacementService"]}},"/api/displacement/v1/get-population-exposure":{"get":{"description":"GetPopulationExposure returns country population data or estimates population within a radius.","operationId":"GetPopulationExposure","parameters":[{"description":"Mode: \"countries\" (default) or \"exposure\".","in":"query","name":"mode","required":false,"schema":{"type":"string"}},{"description":"Latitude (required for exposure mode).","in":"query","name":"lat","required":false,"schema":{"format":"double","type":"number"}},{"description":"Longitude (required for exposure mode).","in":"query","name":"lon","required":false,"schema":{"format":"double","type":"number"}},{"description":"Radius in km (required for exposure mode, defaults to 50).","in":"query","name":"radius","required":false,"schema":{"format":"double","type":"number"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPopulationExposureResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"GetPopulationExposure","tags":["DisplacementService"]}}}}