Trying to fix guild response schemas #1180
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.
Initial bug: Creating a guild (
POST /api/guilds
) returns a lot more properties than justid
.Looking at this more, some schemas extended
Guild
which caused them to include properties likesystem_channel
(notsystem_channel_id
) orchannel_ordering
, both of which aren't returned in the response when stringifying a guild.I'm not really sure about using
| undefined
as type, it's used inIReadyGuildDTO
- they might have to be marked as nullable/optional instead.Looking at the generated schema (replace with
spec-url="https://raw.githubusercontent.com/DEVTomatoCake/spacebar-server/fix/guild-create-response-schema/assets/openapi.json"
in<rapi-doc>
on https://docs.spacebar.chat/routes/#patch-/guilds/-guild_id-/) looks better.