Skip to content

Conversation

@runyasak
Copy link
Contributor

Overview

TypeBox enums were being converted to anyOf format instead of the standard OpenAPI enum format, which caused issues in API documentation generation.
So, I implemented support for converting enums to proper OpenAPI format.

Scope of work

Added convertEnumToOpenApi function for converting TypeBox enum to OpenAPI

Screenshot

image

Discussions

I'm not certain about the good approach for inferring schema type.
While I recognize that using any is not a good practice, I implemented it for ease of development.
I would appreciate your suggestions on how to improve type safety in this area.


This is my first PR for this project. If you have any feedback or suggestions, please do not hesitate to let me know. I will update the PR as soon as possible.

body,
definitions
)
const { type: _type, description, $ref, ...options } = convertedBody
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwrapReference is missing, but I can handle that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I apologized for implementing unwrapReference.
Thank you for handling it for me.

@SaltyAom
Copy link
Member

Chat_emote_88000021

@SaltyAom SaltyAom merged commit 3a318dd into elysiajs:main Sep 21, 2025
1 check passed
@runyasak
Copy link
Contributor Author

@SaltyAom Thank you so much for reviewing and merging my PR krub.
I've just tested for working without checking my code. I will give more attention to my next PR.

@SaltyAom
Copy link
Member

Don't worry, I added a test case to prevent it from breaking for the next time

Anyway, nice PR, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants