All Projects → department-of-veterans-affairs → vets-json-schema

department-of-veterans-affairs / vets-json-schema

Licence: other
JSON Schema for all Vets.gov projects

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

vets-json-schema Build Status

Purpose

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.

Development

Workflow

  1. Clone the repo
  2. Make a branch for your changes
  3. Make the changes needed for your form
  4. Update the version number in package.json
  5. Submit a PR
  6. Once that PR is merged
    1. Create a PR in vets-website to update the vets-json-schema dependency
      • This can be done with yarn update:schema
    2. If adding or removing a form, update forms tests in vets-website
    3. Create a PR in vets-api to update the dependency

Environment

node v8.10.0

I want to...

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

Updating Version

  • Update the "version" property in package.json with 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 additionalProperties set to false
      • Making a property required that was not previously required on that schema
      • Changing the type on a schema's property
      • Removing values in the enum key of a schema's property
      • ect.
  • Run yarn update.
  • Commit the changes to package.json and yarn.lock
  • After changes to vets-json-schema have been merged into master:
    • update vets-website to point to the latest vets-json-schema version by running yarn update:schema and making a PR
    • update vets-api by running bundle update vets_json_schema and making a PR. Caution: verify that you changes are only related to vets_json_schema version. If you see sidekiq changes, follow these instructions
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].