-
Notifications
You must be signed in to change notification settings - Fork 42
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
Ignore whitespace when parsing examples #278
Conversation
Updates examples parser to ignore whitespace. If a YAML document is provided that contains only whitespace then it is skipped, but does not cause an error. This is in alignment with the API types parser. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Updates the examples parser to annotate the error if the ReadCloser supports doing so. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes improve the situation, but it is still possible to encounter issues. Converting to draft temporarily.
if isWhiteSpace(bytes) { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on adding a test case or two for the behavior you're seeing? I clearly failed to add tests in this package the first time through 😞 , but in the event we find a fix, it would be good to know if/when we accidentally regressed the changes 👍.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, will add tests before moving out of draft -- I discovered this is an issue upstream as well though so will likely fix then propagate 👍🏻
@hasheddan Is this PR still relevant? |
@muvaf it is still relevant but is is not ready to be merged. I'll see if I can push this forward or convert to an issue 👍🏻 |
Description of your changes
Updates examples parser to ignore whitespace. If a YAML document is provided that contains only whitespace then it is skipped, but does not cause an error. This is in alignment with the API types parser.
Signed-off-by: hasheddan georgedanielmangum@gmail.com
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
Testing in progress.. will be updated shortly.