mes-api-definitions
These are the REST API definitions (OpenAPI and JSON Schema) for the Mobile Examiner Services project, for our backend microservices to implement, and our frontend mobile app to consume.
API Docs
See OpenAPI Definition.
Usage
Example category B schema usage:
import { StandardCarTestCATBSchema } from '@dvsa/mes-test-schema/categories/B';
Generating schemas for mes-test-schema
To clean current schemas, run the command:
npm run clean
To generate new schemas, (Combining the partials and common schema), run the command:
npm run generate
NOTE: The category specific index.d.ts files were initially generated but have been modified by hand to create the category specific namespaces. These files should not be deleted nor regenerated but any new types should be added manually.
Updating a schema
Always make your edits to the json schema files (except for the category index.json
files, these are auto-generated) and not the generated TypeScript definition files (ending in .d.ts). The general process for updating a schema is:-
- Make edits to the relevant json schema file
- Generate the new TypeScript definitions using
npm run generate
- Ensure you are in the correct directory - If necessary, update the
index.d.ts
- Bump the version of the package using
npm version {major|minor|patch}
- Ensure you are in the correct directory - Raise a Pull Request on Github and await approvals
- Publish the new package to npm using
npm publish
- You must be logged in and have the correct permissions to publish to the @dvsa npm org