The Bluetooth Numbers Database uses two validation scripts that must both pass before any pull request can be merged. The first validates every data file against its JSON Schema; the second checks for duplicate entries and malformed UUIDs. Running both locally before opening a PR saves time and avoids unnecessary CI failures.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nordicsemi/bluetooth-numbers-database/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
You need Node.js 12 or later and npm installed on your machine. Clone the repository and install dependencies:JSON Schema Validation (npm test)
The npm test command runs node validate, which loads all database files through the project’s index module and validates each one against its corresponding JSON Schema using the AJV library.
| Data file | Schema used |
|---|---|
v1/company_ids.json | v1/company_schema.json |
v1/service_uuids.json | v1/attribute_schema.json |
v1/characteristic_uuids.json | v1/attribute_schema.json |
v1/descriptor_uuids.json | v1/attribute_schema.json |
v1/gap_appearance.json | v1/appearance_schema.json |
schemas and version), looks up the corresponding schema, and calls ajv.validate(). If all files are valid, the process exits with code 0. If any file fails, AJV prints the schema errors to stderr and the process exits with code 1:
0. A failing run prints messages such as:
Duplicate Check (npm run verify)
The npm run verify command runs node verify, which checks for duplicate keys and validates UUID string format across all data files.
| Data type | Checked fields |
|---|---|
Companies (company_ids.json) | No duplicate code integer values |
| GATT Attributes (services, characteristics, descriptors) | No duplicate identifier strings; all uuid values match the format regex |
Appearances (gap_appearance.json) | No duplicate category integer values |
verify.js is:
GitHub Actions
Two CI workflows run automatically on every push and every pull request. Both must pass for a PR to be eligible for merging:| Workflow | Command | Trigger |
|---|---|---|
| Verify JSON Schemas | npm test | Every push and pull request |
| Check No Duplicates | npm run verify | Every push and pull request |
Troubleshooting
AJV reports an error about the uuid format
AJV reports an error about the uuid format
The Common causes of failure:
attribute_schema.json enforces this pattern for the uuid field:- Lowercase hex letters — convert all
a–ftoA–F. - Wrong grouping — the 128-bit format must be
8-4-4-4-12characters separated by hyphens. - Braces or extra characters — do not include
{}around the UUID. - 16-bit UUID for a new entry — new proprietary entries must use 128-bit UUIDs.
uuidgen on macOS/Linux, or an online tool) and then convert the result to uppercase before adding it to the JSON file.Duplicate identifier error from npm run verify
Duplicate identifier error from npm run verify
The Search the relevant file for the identifier before adding your entry:If a match is found, choose a more specific identifier that is unique to your entry — for example, append a version or a more descriptive use-case segment.
verify.js script scans each GATT attribute file for duplicate identifier strings. If you see:npm install fails or reports engine warnings
npm install fails or reports engine warnings
The project requires Node.js v12 or later. Check your current version:If the output shows a version below
v12, upgrade Node.js using your system package manager, nvm, or by downloading an installer from nodejs.org.After upgrading, delete node_modules and reinstall:validate.js reports a missing schema error
validate.js reports a missing schema error
If you see:This means a key exported by the index module does not have a corresponding entry in
db.schemas. This should not happen with normal contributions to the existing JSON files. If you are adding a completely new data file and index export, ensure the corresponding schema file exists and is registered in the index module.