Skip to content

codeforamerica/safety-net-openapi

Repository files navigation

Safety Net OpenAPI Toolkit

This toolkit helps teams build consistent, well-documented APIs for safety net programs—enabling faster integration between benefits systems and reducing the technical barriers to improving service delivery.

It provides a standardized foundation for designing APIs that handle common patterns in benefits administration: searching and filtering records, managing cases and applications, and exchanging eligibility data between systems. By codifying these patterns into reusable templates and validation rules, teams can focus on their domain logic rather than reinventing API conventions.

The toolkit generates mock servers, TypeScript clients, and Postman collections from your OpenAPI specifications, making it easier to prototype integrations and onboard developers.

Quick Start

npm install
npm start                # Mock server (1080) + Swagger UI (3000)

Visit http://localhost:3000 for interactive API docs, or test directly:

curl http://localhost:1080/persons

Commands

Command Description
npm start Start mock server + Swagger UI
npm run validate Validate specs and examples
npm run api:new -- --name "x" --resource "X" Generate new API from template
npm run clients:generate Generate TypeScript/Zodios clients
npm run postman:generate Generate Postman collection
npm test Run unit tests
npm run test:all Run all tests (unit + integration)
npm run mock:reset Reset database to example data

Documentation

Guide Description
Creating APIs Generate new APIs with established patterns
Validation Spec validation and linting rules
Mock Server Search, pagination, and CRUD operations
Testing Unit tests, integration tests, Postman, Swagger UI
API Clients TypeScript/Zodios client generation
Developer Guide Project structure, extending, troubleshooting

Requirements

Node.js >= 18.0.0

License

PolyForm Noncommercial License 1.0.0

About

OpenAPI Specifications for Safety Net Applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •