fix: update typings to match api response #763
Merged
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.
Pull Request Type
How to test this PR
Request a random story and log the result, compare what you get with what the typing says you should've gotten.
Example:
What is the new behavior?
This fixes the typings that were broken in #697 and makes sure that the typing actually matches the API response.
All of these are on the
ISbStoryData
interface.Many are fields have to be optional, as they are not always returned. I've marked them as optional as well, because you specifically requested that from the last fix, although the API does return
null
instead in many cases, so this will still be slightly incorrect typing.One of the changes stands out, and that is marking
parent
as optional. Anything else is impossible over JSON, as a recursive structure needs an anchor; the root element does not have a parent.Other information