-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improve error message format #13
Comments
I've been working on reformatting the message. For example MIS_E001 would now print out:
instead of:
I plan to submit a pull request fixing the issue. |
@yyang08: you're definitely correct, having more human messages is something that we should look for. Originally the tool was built internally to be embedded into CI systems, so we did not invest a lot of time on making the messages more readable (as we were mostly relying on the JSON output). Let me know if you will provide a PR for this! PS: Sorry for the huge delay on dropping a comment :) |
@macisamuele I've already implemented this. However, fixing all the tests is a huge headache because they all expect to see an error message with reference like Do you have suggestion for this? |
@yyang08 without checking the code it would be a bit hard to say. A possible approach might be by using mocks, we might:
Something that I would suggest is to create a PR with what you already have. |
@macisamuele I created a PR and you can see the file changes here (https://github.com/Yelp/swagger-spec-compatibility/pull/15/files). Though I dont have much experience with unit testing in python, I think mocking |
@yyang08 the PR is a starting point for understanding how to update tests.
Something that I did used to get a better understanding of mocks was https://realpython.com/python-mock-library/. |
The error message currently printed out doesn't directly give user the information they need. For example, if a user changes the type of a schema, the user would see:
The "#/path//..." is hard to follow and not providing much useful information. Users just need to know 1) the property that has changed, 2) the endpoint & the method that are being affected by the change, 3) the error rule and 4) the link to the documentation explaining the rule. Similar case for other error rules.
We could simplify and clarify the error message so that it's more user-friendly, similar to another widely-adopted library swagger-diff has done it.
The text was updated successfully, but these errors were encountered: