building-envelope-data / api

API specification to exchange data about building envelopes
MIT License
3 stars 1 forks source link

Correct the schema identifier.json #235

Closed christoph-maurer closed 3 years ago

christoph-maurer commented 3 years ago

The tests of uuidWithHyphen.json and uuidWithoutHyphen.json against identifier.json are both valid. However, smallGeneralComponentWithoutHyphen.json is invalid against dbe.json:

./examples/dbe/smallGeneralComponentWithoutHyphen.json invalid
[
  {
    instancePath: '/components/0/id',
    schemaPath: '#/$defs/central/format',
    keyword: 'format',
    params: { format: 'uuid' },
    message: 'must match format "uuid"'
  },
  {
    instancePath: '/components/0/id',
    schemaPath: '#/$defs/decentral/type',
    keyword: 'type',
    params: { type: 'object' },
    message: 'must be object'
  },
  {
    instancePath: '/components/0/id',
    schemaPath: '#/oneOf',
    keyword: 'oneOf',
    params: { passingSchemas: null },
    message: 'must match exactly one schema in oneOf'
  }
]

@simon-wacker Do you know why?

simon-wacker commented 3 years ago

Regarding why smallGeneralComponentWithoutHyphen is invalid: As the first error message says, it's not a valid UUID. We use ajv-formats to test for validity of UUIDs, which uses the standard RFC 4122, and in this hyphens are required.

christoph-maurer commented 3 years ago

I have corrected identifier.json. The definition of decentral was lacking additionalProperties: false and required: [value,issuedBy]. I added some tests and corrected some examples.

I have renamed CRI to ColorRenderingIndex.