Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print ID of schema in schema-enforcer validate output #89

Open
PhillSimonds opened this issue Feb 11, 2021 · 0 comments
Open

Print ID of schema in schema-enforcer validate output #89

PhillSimonds opened this issue Feb 11, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@PhillSimonds
Copy link
Contributor

PhillSimonds commented Feb 11, 2021

Environment

  • Python version: 3.7.9
  • schema-enforcer version: 1.0.1

Proposed Functionality

Right now, when two schemas are used to evaluate the same schema file, all checks pass, and the schema-enforcer validate --show-pass command is run -- it outputs the same pass message for both schemas. Neither of these messages indicates which schema is passing.

Use Case

Here is an example of the validate command run when two schemas are used to validate the data in the ./data/data.yml file

# jsonschema: schemas/dns_servers,schemas/syslog_servers
---
dns_servers:
  - address: "10.1.1.1"
  - address: "10.2.2.2"
syslog_servers:
  - address: "10.3.3.3"
chema-enforcer validate --show-pass
PASS | [FILE] ./data/data.yml
PASS | [FILE] ./data/data.yml
ALL SCHEMA VALIDATION CHECKS PASSED

It would be nice if the output were such that it showed which schema is validating the data when the pass message is generated.

chema-enforcer validate --show-pass
PASS | [FILE] ./data/data.yml [SCHEMA] schemas/dns_servers
PASS | [FILE] ./data/data.yml [SCHEMA] schemas/syslog_servers
ALL SCHEMA VALIDATION CHECKS PASSED

It would also be nice if the fail messages printed the schema location as well. Here is the current output of the fail message

PASS | [FILE] ./data/data.yml
FAIL | [ERROR] True is not of type 'string' [FILE] ./data/data.yml [PROPERTY] dns_servers:0:address

Here is the proposed output:

PASS | [FILE] ./data/data.yml [SCHEMA] schemas/syslog_servers
FAIL | [ERROR] True is not of type 'string' [FILE] ./data/data.yml [PROPERTY] dns_servers:0:address [SCHEMA] schemas/dns_servers
@PhillSimonds PhillSimonds changed the title Add schema enforcer logo Print ID of schema in schema-enforcer validate output Feb 12, 2021
@dgarros dgarros added the enhancement New feature or request label Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants