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

Changes the default Endpoint.outStream[X] encoding to produce a JSON array #3122

Merged
merged 15 commits into from
Sep 20, 2024

Conversation

gregor-rayman
Copy link
Contributor

@gregor-rayman gregor-rayman commented Sep 10, 2024

Changes the default response encoding of Endpoint.outStream[X] for the MIME type application/json so that is produces a valid JSON array instead of just concatenated JSON entities.

Fixes #3113, /claim #3113

…the MIME type `application/json` so that is produces a valid JSON array.

Before it would simply produce concatenated JSON representations of the elements. For numeric `X` the response would not be parsable.
Copy link

algora-pbc bot commented Sep 10, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

@codecov-commenter
Copy link

codecov-commenter commented Sep 10, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 74.07407% with 21 lines in your changes missing coverage. Please review.

Project coverage is 65.29%. Comparing base (58498bd) to head (8465f75).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
...c/main/scala/zio/http/codec/HttpContentCodec.scala 70.83% 21 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3122      +/-   ##
==========================================
- Coverage   65.66%   65.29%   -0.38%     
==========================================
  Files         157      161       +4     
  Lines       10266    10629     +363     
  Branches     1929     2004      +75     
==========================================
+ Hits         6741     6940     +199     
- Misses       3525     3689     +164     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…` for the MIME type `application/json` to JSON array reflected in the generated OpenAPI.
@gregor-rayman
Copy link
Contributor Author

gregor-rayman commented Sep 10, 2024

Now the OpenAPI generation is done.

I hope I have implemented all the needed changes and tests.

There are two small things that could improve this in my opinion:

It will also mitigate the codeconv-commenter complaint, as in zio-schema the corresponding parts are covered.

@gregor-rayman gregor-rayman marked this pull request as ready for review September 10, 2024 19:46
@987Nabil
Copy link
Contributor

@gregor-rayman please use the snapshot build of zip schema and make the simplifications you mentioned. If it works, I'll release zio-schema and we can use the released version before merging your pr.

@gregor-rayman
Copy link
Contributor Author

@987Nabil , done.

gregor-rayman and others added 10 commits September 16, 2024 12:06
…3151)

* gen: failing test: code is only generated for last response

* Fix zio#3103 Only last response is generated into Endpoint code
…the MIME type `application/json` so that is produces a valid JSON array.

Before it would simply produce concatenated JSON representations of the elements. For numeric `X` the response would not be parsable.
…` for the MIME type `application/json` to JSON array reflected in the generated OpenAPI.
@gregor-rayman
Copy link
Contributor Author

@987Nabil , I have upgraded the zio-schema dependency to 1.5.0

@987Nabil 987Nabil merged commit 502331c into zio:main Sep 20, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants