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

JsonContent doesn't send correctly #378

Open
egmacke opened this issue May 6, 2022 · 7 comments
Open

JsonContent doesn't send correctly #378

egmacke opened this issue May 6, 2022 · 7 comments

Comments

@egmacke
Copy link
Contributor

egmacke commented May 6, 2022

When using the BaseHttpController helper method BaseHttpController.json(...) the resulting express call coerces the json object to a string.

This causes problems when using express middleware that validates JSON responses (in this case using openapi-validator-middleware) as the data is no-longer a JSON object.

The root cause of this appears to be that the use of HttpContent enforcing all data as a string in readAsStringAsync().

My understanding is that this is to avoid potential issues where numeric data is interpreted by express as a status code, but I believe that it would be safe to all string | object types to be sent.

I will open a PR shortly with a proposed fix for this.

@egmacke
Copy link
Contributor Author

egmacke commented May 24, 2022

@dcavanagh What's the release cycle for this repo? Just wondering when I'll be able to make use of this as part of a released version?

@dweller23
Copy link

Hello, are there any plans to release a new version including this fix @dcavanagh ?

@Jameskmonger
Copy link
Member

@egmacke @dweller23 sorry for the delay, I will publish this as 6.4.4 when I finish work today (#390)

@Jameskmonger
Copy link
Member

Pleased to say this is now published on npm in version 6.4.4 @egmacke @dweller23

Apologies for the delay, I will be part of the regular project maintainers now to resolve any issues going forwards. Thank you for your patience

cc @GrzegorzKozub @mcrg (you 👍'ed the comment)

@Jameskmonger
Copy link
Member

Jameskmonger commented Oct 26, 2023

There was an issue with the publish process in 6.4.4, I have deprecated the release and am working to publish a new version now

@Jameskmonger
Copy link
Member

There are some breaking changes in the TypeScript upgrade/modernisation which must be resolved/documented before releasing. Please track the progress here #396.

This is my top priority ATM and I hope to have it resolved in the next few days

@egmacke
Copy link
Contributor Author

egmacke commented Jan 4, 2024

@Jameskmonger #396 looks to be resolved, but there's not been a release since. Is there any update on this?

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

No branches or pull requests

3 participants