Skip to content

Handle empty yaml files #125

Description

@innerhippy

Environment

  • Python version: 3.9
  • schema-enforcer version: 1.1.2

Expected Behavior

run schema-enforcer validate without errors

Observed Behavior

Stack trace when loading empty yaml files

self._top_level_properties = set(content.keys())
AttributeError: 'NoneType' object has no attribute 'keys' 

Steps to Reproduce

  1. Add empty yaml file in directory structure
  2. run validate command

Addition of simple conditional in schema_enforcer/instances/file.py line 100 fixes issue

if content:
    self._top_level_properties = set(content.keys())

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions