spacebarchat / server

Spacebar server - A reimplementation of the Discord.com backend, built with Typescript and love
https://spacebar.chat
GNU Affero General Public License v3.0
1.49k stars 250 forks source link

Trying to fix guild response schemas #1180

Closed DEVTomatoCake closed 3 months ago

DEVTomatoCake commented 3 months ago

Initial bug: Creating a guild (POST /api/guilds) returns a lot more properties than just id.

Looking at this more, some schemas extended Guild which caused them to include properties like system_channel (not system_channel_id) or channel_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 in IReadyGuildDTO - 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.

MaddyUnderStars commented 3 months ago

When you can, could you fix the schema conflict, then I'll merge