getappmap / getappmap/appmap-js
Implement json schema validation for configuration file
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 18
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Some boiler plate code to get started.
Resource: https://ajv.js.org
// validate.js
import * as FileSystem from 'fs';
import YAML from 'yaml';
import Ajv from 'ajv';
const schema = process.argv[2];
const instance = process.argv[3];
const ajv = new Ajv();
const validate = ajv.compile(
YAML.parse(
FileSystem.readFileSync(schema, 'utf8'),
),
);
if (
!validate(
YAML.parse(
FileSystem.readFileSync(instance, 'utf8'),
),
)
) {
for (let error of validate.errors) {
console.log(error);
}
process.exitCode = 1;
};
node validate config-schema.yml appmap.yml
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed validate.js entry point and review the AJV resource, config-schema.yml, and appmap.yml examples. Run the shown node validate config-schema.yml appmap.yml command to understand the expected input and error output. Done means configuration files are validated and invalid input produces actionable errors with a failing exit status.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, yaml
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100