Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 3.01 KB

DOCUMENTATION.md

File metadata and controls

36 lines (21 loc) · 3.01 KB

IBF API Documentation describes the IBF REST API which allows programmatic controlled access to the IBF-database.

What information is accessible via the IBF REST API?

Disaster forecast, indicator and early action information is available in JSON format.

Can I access the IBF REST API?

You need to be authorized to access this information. You must request 510.global for authorization.

How to update IBF API Documentation?

The official NestJS OpenAPI is the source reference. The NestJS Swagger module provides decorators to add to controllers and entities.

For example, /api/user is defined in UserController.

On line 35, ApiOperation decorator allows us to add a description using the summary parameter.

On lines 36-40, ApiResponse decorator allows us to describe what the response object would look like.

On line 48 sets the expected structure of the request body. ApiProperty decorator allows us to provides example and default values via the example and default parameters respectively.

If we make changes to any of the defined decorators and their parameters, we would see a corresponding visual change in the documentation page.

Checklist

  1. Does the API have a description?
  2. Is the security level set appropriately?
  3. Is the schema valid for the endpoint?
  4. Are there examples for each parameter?
  5. Is the schema defined for the request object?
  6. Is the schema defined for the response object?