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 OpenAPI example extraction #2635

Merged
merged 3 commits into from
Jan 21, 2024
Merged

Conversation

987Nabil
Copy link
Contributor

@987Nabil 987Nabil commented Jan 19, 2024

fixes #2609
/claim #2609

  • fix example tuple deconstruction
  • fix example either deconstruction
  • handover examples correctly to path codecs

@jdegoes I see how I can deconstruct tuple examples for combined codecs. But for alternation, we don't have a type class that helps us to deconstruct.
I would add in the docs, that we don't support this for open api gen and that instead of calling inExamples on the endpoint, ppl should call ContentCodec.content[A].examples(...) | ContentCodec.content[B].examples(...).
wdyt?

@jdegoes
Copy link
Member

jdegoes commented Jan 19, 2024

@987Nabil Alternator does have destruction:

See here.

@987Nabil
Copy link
Contributor Author

@jdegoes I missed it, because it was missing from the parameters of Fallback. I will add it, so it can be used later. Then it should be possible to make it work 👍

@987Nabil 987Nabil changed the title Initial scala.js setup Fix OpenAPI example extraction Jan 19, 2024
@987Nabil 987Nabil marked this pull request as ready for review January 20, 2024 15:26
@987Nabil 987Nabil force-pushed the combined-input-examples branch 4 times, most recently from dd2338b to 7a860ec Compare January 20, 2024 22:12
@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2024

Codecov Report

Attention: 44 lines in your changes are missing coverage. Please review.

Comparison is base (a9a2204) 64.84% compared to head (748832b) 65.38%.
Report is 5 commits behind head on main.

Files Patch % Lines
...n/scala/zio/http/endpoint/openapi/OpenAPIGen.scala 60.86% 18 Missing ⚠️
...ared/src/main/scala/zio/http/codec/PathCodec.scala 44.00% 14 Missing ⚠️
.../main/scala/zio/http/codec/internal/Mechanic.scala 33.33% 4 Missing ⚠️
...ared/src/main/scala/zio/http/codec/HttpCodec.scala 91.17% 3 Missing ⚠️
...d/src/main/scala/zio/http/codec/SegmentCodec.scala 75.00% 2 Missing ⚠️
...n/scala/zio/http/endpoint/openapi/JsonSchema.scala 60.00% 2 Missing ⚠️
...scala/zio/http/codec/internal/AtomizedCodecs.scala 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2635      +/-   ##
==========================================
+ Coverage   64.84%   65.38%   +0.54%     
==========================================
  Files         144      144              
  Lines        8488     8407      -81     
  Branches     1582     1532      -50     
==========================================
- Hits         5504     5497       -7     
+ Misses       2984     2910      -74     

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

@jdegoes jdegoes merged commit 6930757 into zio:main Jan 21, 2024
14 checks passed
987Nabil added a commit to 987Nabil/zio-http that referenced this pull request Jan 21, 2024
* Deconstruct tupled examples (zio#2609)

* Deconstruct either examples (zio#2609)

* Handle path examples and add/fix tests (zio#2609)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tuple Error in OpenAPI examples that use query params and POST bodies
3 participants