Fix: Markdown and Console renderer fail when processing range HTTP status code e. g. '2XX' #397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Both Markdown and Console renderer fail when trying to process a range HTTP status code, e. g. '2XX'. So any diff that results in an output including such a status code fails to render for markdown and console.
The error occurs when trying to parse the String HTTP status code into an Integer right here (both in Markdown and Console renderer):
JSON and HTML renderer are not affected, since they do not try to display the 'reason phrase'. Everything else, the actual diff process etc. is also not affected.
Expected behavior
Expected ranges of HTTP status codes, like '2XX' covering all codes between 200-299, to be treated like any other HTTP status code, since they have been part of the OpenAPI specification since version 3.0.0.
Has this been tested?
I've added tests to both renderers with a corresponding test specification checking if the renderer fails.
Checklist: