Parse Json schema for fields

by Steven Senkus

JavaScript

const ezLynxAutoSchema = {
  '$schema': 'http://json-schema.org/draft-04/schema#',
  'type': 'object',
  'additionalProperties': false,
  'properties': {
    'EZAUTO': {
      '$ref': '#/definitions/EZAUTOType'
    }
  },
  'required': [
    'EZAUTO'
  ],
  'definitions': {
    'EZAUTO': {},
    'NameType': {
      'type': 'object',
      'additionalProperties': true,
      'properties': {
        'Prefix': {
          '$ref': '#/definitions/NamePrefixType'
        },
        'FirstName': {
          '$ref': '#/definitions/ProperName'
        },
        'MiddleName': {
          '$ref': '#/definitions/MiddleInitial'
        },
        'LastName': {
          '$ref': '#/definitions/ProperName'
        },
        'Suffix': {
          '$ref': '#/definitions/NameSuffixType'
        }
      }
    },
    'PersonalInfoType': {
      'type': 'object',
      'additionalProperties': true,
      'properties': {
        'Name': {
          '$ref': '#/definitions/NameType'
        },
        'DOB': {
          '$ref': '#/definitions/DateType'
        },
        'SSN': {
          '$ref': '#/definitions/SSNType'
        },
        'Gender': {
          '$ref': '#/definitions/GenderType'
        },
        'MaritalStatus': {
          '$ref': '#/definitions/MaritalStatusType'
        },
        'Industry': {
          'type': 'string'
        },
        'Occupation': {
          'type': 'string'
        },
        'YearsWithEmployer': {
          'type': 'integer',
          'minimum': 0,
          'exclusiveMinimum': false
        },
        'YearsWithPreviousEmployer': {
          'type': 'integer',
          'minimum': 0,
          'exclusiveMinimum': false
        },
        'Education': {
          '$ref': '#/definitions/EducationType'
        },
        'LicensedToDrive': {
          '$ref': '#/definitions/BooleanType'
        },
        'Relation': {
          '$ref': '#/definitions/RelationType'
        },
        'MaidenName': {
          'type': 'string'
        },
 ...