I'm looking to add support for datacontract-specification to Data Caterer. I'm using the JSON schema to define how to ingest the metadata from the data contract. Using the examples, I found some validation errors in the servers section. Also, using the tool ajv to help validate the JSON schema, it stated that x-extensible-enum is not valid for JSON schema draft-07.
Problem
It seems like due to type: dataframe not having any properties defined, it becomes the default server from the oneOf list in the JSON schema.
This also has the side effect of the IDE or consumer of the JSON schema to suggest properties from any of the server types.
Another small issue that I'm not sure if it is an issue or not, but the description and environment properties under servers are applied at the top-level object. Is this meant to be at the top level or per server? In this PR, I have included it at the per-server level.
Context
I'm looking to add support for datacontract-specification to Data Caterer. I'm using the JSON schema to define how to ingest the metadata from the data contract. Using the examples, I found some validation errors in the
servers
section. Also, using the toolajv
to help validate the JSON schema, it stated thatx-extensible-enum
is not valid for JSON schema draft-07.Problem
It seems like due to
type: dataframe
not having anyproperties
defined, it becomes the defaultserver
from theoneOf
list in the JSON schema.This also has the side effect of the IDE or consumer of the JSON schema to suggest properties from any of the server types.
Another small issue that I'm not sure if it is an issue or not, but the
description
andenvironment
properties underservers
are applied at the top-level object. Is this meant to be at the top level or per server? In this PR, I have included it at the per-server level.Proposed Solution
type
(for reference https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse)BaseServer
in$defs
$defs
What
postgres
property suggestions look like after using above changes: