An OpenAPI project for Nigerian beginners can start with one lookup and three clear answers. Define what the application returns before building its screen. A second developer should be able to implement the screen from that agreement, without guessing what an error means.
Our example is a fictional public-service directory. SVC-001 names a made-up service, while SVC-999 is a valid-looking ID with no matching record. The exercise uses no citizen information, government credentials or real service endpoint.
What the NITDA document contributes
NITDA’s download listing dated 30 November links the Nigerian Government Enterprise Architecture, version 2.0. Section 18(3)(a) describes API-first government application design and OpenAPI 3.x documentation. That provides a useful teaching context for writing the contract first.
The supplied brief called this a draft. The retrieved file’s cover says version 2.0, 2026, without a draft label. Therefore, this article does not establish its adoption or implementation status from the listing alone. Nor does it announce a live API or treat the document as a blanket new rule for private websites. Its stated scope concerns government architecture and related suppliers and integrations.
Define the lookup before choosing a backend
Use GET /services/{id} as the teaching route. Require an ID shaped like SVC- followed by exactly three digits. First check the shape; only then search the fictional records. This order separates a malformed request from a well-formed request whose record does not exist.
| Input | Expected status | Required body fields | Screen response |
|---|---|---|---|
| SVC-001 | 200 | id, name | Show the matching service |
| bad-id | 400 | error, message | Ask the user to correct the ID |
| SVC-999 | 404 | error, message | Say no service matches that valid ID |
For a successful lookup, return id and name as strings. An error instead needs a stable error code and a readable message. For example, SVC-001 might return the fabricated name Community Learning Desk. A 400 response can use invalid_id; a 404 response can use service_not_found. Keep the names stable across frontend and backend work.

Turn the OpenAPI project into a contract card
In an OpenAPI 3.x description, declare the path parameter as required and give it a string pattern. Describe the 200, 400 and 404 response bodies separately. Add the same fabricated examples to the schema and the screen mock-up. A status code alone does not tell a frontend which fields it can safely read.

Ask your partner to build the interface using only this card and the field dictionary. They should show the service name for 200, a correction prompt for 400 and a no-match message for 404. Preserve what the user typed after an error so they can fix it. Avoid presenting every failure as an empty successful result.
Test the agreement, then record observations
The downloadable ledger contains three planned cases and blank observation columns. No server was deployed or tested for this report. After implementing your own local fixture, enter the actual status, response body and result. Add boundary cases such as an empty ID, the wrong number of digits and missing required response fields.
Then change one contract detail deliberately in a disposable copy. For instance, remove name from the success body. Check whether your test catches the mismatch. Restore the agreement before sharing the exercise. This checks a concrete dependency rather than treating a page that loads as proof of a correct integration.
Download the beginner project worksheets
- Fictional lookup contract (CSV)
- Blank API test ledger (CSV)
- Response field dictionary (CSV)
- Primary-source register (CSV)
Use the Programming Projects archive for related learning material. Cite this exercise as Nigeria Coding Academy, OpenAPI project for Nigerian beginners, 1 December 2026, with NITDA credited for the architecture context. The fabricated records and test design are ours; they are not evidence about an operational public service.
