Forms on VA.gov use JSON schema to define a common contract for data validation between the front and back ends. This is where those schemas are kept.
-
Clone the
vets-json-schemarepository -
Create a new branch for your changes
-
Make any required changes needed for your form schema
-
Update the version number in this repo's
package.json- Ensure that you run
yarn buildto generate thedist/directory where your form schema will be pulled from - Commit your changes to your branch
- Ensure that you run
-
Submit a Pull Request in
vets-json-schema -
Once that PR is merged into
vets-json-schemaatmaster-
In
vets-websiteto update thevets-json-schemadependency do the following:- Create a new branch
- Find the latest commit hash for
vets-json-schema#master(see all commits) - Run
yarn remove vets-json-schema - Run
yarn add https://github.com/department-of-veterans-affairs/vets-json-schema.git\#<commit-hash> - Run
yarn update:schema - Create a Pull Request
-
In
vets-apito update thevets-json-schemadependency do the following:- Create a new branch
- Run
bundle update vets_json_schema
-
If adding or removing a form, update forms tests in
vets-website
What to do in vets-json-schema:
- Add your changes on your branch in vets-json-schema
- Run
yarn buildto generate thedist/directory where your form schema will be pulled from - run
yarn run local-link"local-link" updates your personal vets-api bundler config to use this local repo, rather than the Gem in Gemfile.lock AND runsyarn linkin vets-website to link to this directory - After local dev/testing is complete, run run
yarn run local-unlinkto revert to your original config in vets-website and vets-api
node v8.10.0
| I want to... | Then you should... |
|---|---|
| clone the repo | git clone https://github.com/department-of-veterans-affairs/vets-json-schema.git followed by cd vets-json-schema, yarn install. Run yarn install any time package.json changes. |
| build the json schemas and examples | yarn run build |
| watch for changes and rebuild when they happen | yarn run watch |
| run tests on the built schemas | yarn run test |
| create a new schema | https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/engineering/frontend/vets-website/creating-form-schema.md |
| link library for local development | yarn run local-link or yarn run local-unlink |
- Update the "version" property in
package.jsonwith the new version. Please follow Semantic Versioning practices.- If implementing a major version update, add a link in your vets-json-schema PR that references the vets-api, or vets-website, PR that addresses the breaking changes.
- Breaking changes include:
- Removing a property from a schema
- Adding a property to a schema that has
additionalPropertiesset to false - Making a property required that was not previously required on that schema
- Changing the
typeon a schema's property - Removing values in the
enumkey of a schema's property - ect.
- Run
yarn update. - Commit the changes to
package.jsonandyarn.lock - After changes to
vets-json-schemahave been merged into master:- update
vets-websiteto point to the latestvets-json-schemaversion by runningyarn update:schemaand making a PR - update
vets-apiby runningbundle update vets_json_schemaand making a PR. Caution: verify that you changes are only related to vets_json_schema version. If you see sidekiq changes, follow these instructions
- update
- If you're on a VA.gov Platform team, contact your Program Manager.
- If you're on a VFS team, you must complete Platform Orientation to be added to this repository. This includes completing your Platform Orientation ticket(s) in GitHub.