Skip to content

data.json validation fails if null is provided for a relationship #36

@abstratt

Description

@abstratt

data.json validation fails if null is provided for a relationship:

Deploy failed: ERROR: null expected to be an object or reference - data.json : 1

    private void validateReferenceOrInstance(String currentNamespace, JsonNode jsonNode, TypeRef typeRef) {
        if (jsonNode.isTextual()) {
            validateReference(typeRef, currentNamespace, jsonNode);
        } else if (jsonNode.isObject()) {
            Entity referredEntity = schema.getEntity(typeRef.getEntityNamespace(), typeRef.getTypeName());
            validateInstance(referredEntity, jsonNode);
        } else {
            collector.addError(jsonNode + " expected to be an object or reference");
            return;
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions