Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply proper type to each @ApiQuery decorator in the API contr… #311

Merged

Conversation

RobbyUitbeijerse
Copy link
Contributor

Hi!

The hosted OpenAPI spec that is abstracted from the @ApiProperty decorators using @nestjs/swagger is missing certain types. This is easy to check by simply opening the OpenAPI spec and checking the very first method and it's input parameters.

Screenshot 2024-11-07 at 16 31 07

The schema type the input parameter address is set to {} - this causes request client generators like OpenAPI generator to interpret the parameter as an object, rather than the desired string.

To mitigate this, I simply added the type property in every @ApiQuery decorator instance, which should lead to proper output in the OpenAPI spec.

Let me know if you would like to see any changes here.

@popzxc popzxc requested a review from vasyl-ivanchuk November 7, 2024 17:10
@vasyl-ivanchuk vasyl-ivanchuk changed the title chore: apply proper type to each @ApiQuery decorator in the API contr… fix: apply proper type to each @ApiQuery decorator in the API contr… Nov 8, 2024
@vasyl-ivanchuk
Copy link
Collaborator

I changed the PR title to fix so that the new release version is created by the GitHub workflow. Otherwise, LGTM.

@vasyl-ivanchuk vasyl-ivanchuk merged commit ad1dc14 into matter-labs:main Nov 11, 2024
11 of 21 checks passed
Copy link

🎉 This PR is included in version 2.50.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants