Fix parsing no content into null instead of 'null' #911
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.
Hello 👋
Thank you for the package, we are really enjoying all the work you put into it. I hope you will accept this small change which we think might be a bug :)
Problem
When having a response with no content in it, it ends up showing as plaintext in openapi spec.
Will be generated as
solution
To fix this problem, we make sure that if the content is null, we pass
null
forward when converting the attribute to an array. Previously thenull
value was passed throughjson_encode
which will convert it into'null'
.After this solution, we end up with