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: use default values for optional httpPayload if there is no body #1511

Merged
merged 9 commits into from
Jun 19, 2024

Conversation

ghostbuster91
Copy link
Contributor

@ghostbuster91 ghostbuster91 commented May 6, 2024

Related PR in alloy: disneystreaming/alloy#163
This closes #1502

TODO:

  • Update alloy dependency once released

PR Checklist (not all items are relevant to all PRs)

  • Added unit-tests (for runtime code)
  • Added bootstrapped code + smoke tests (when the rendering logic is modified)
  • Added build-plugins integration tests (when reflection loading is required at codegen-time)
  • Added alloy compliance tests (when simpleRestJson protocol behaviour is expanded/updated)
  • Updated dynamic module to match generated-code behaviour
  • Added documentation
  • Updated changelog

@ghostbuster91 ghostbuster91 changed the title Default payload fix: use default values for optional httpPaylaod if there is no body May 6, 2024
@ghostbuster91
Copy link
Contributor Author

This currently fails with the linked version of alloy due to:

[info] [http4s] smithy4s.http4s.SimpleRestJsonComplianceSuite
[error] [http4s] - alloy.test#HttpPayloadWithDefault(client|Request): SimpleRestJsonSomeHttpPayloadWithDefault 5ms
[error] [http4s]   Header Content-Type has value `text/plain` but expected `application/json` (modules/tests/src/smithy4s/tests/ProtocolComplianceSuite.scala:180)
[error] [http4s]
[error] [http4s]     [INFO] 17:34:32 [ProtocolComplianceSuite.scala:170] Pass simple string value as is if payload provided
[error] [http4s]
[error] [http4s] - alloy.test#HttpPayloadWithDefault(client|Request): SimpleRestJsonNoneHttpPayloadWithDefault 5ms
[error] [http4s]   Header Content-Type has value `text/plain` but expected `application/json` (modules/tests/src/smithy4s/tests/ProtocolComplianceSuite.scala:180)
[error] [http4s]
[error] [http4s]     [INFO] 17:34:32 [ProtocolComplianceSuite.scala:170] Use default value when there is no payload
[error] [http4s]

@ghostbuster91 ghostbuster91 marked this pull request as draft May 6, 2024 15:50
@ghostbuster91 ghostbuster91 marked this pull request as ready for review May 6, 2024 16:59
build.sbt Outdated Show resolved Hide resolved
@kubukoz kubukoz changed the title fix: use default values for optional httpPaylaod if there is no body fix: use default values for optional httpPayload if there is no body May 9, 2024
@kubukoz
Copy link
Member

kubukoz commented May 9, 2024

Have you checked this with the latest changes on the alloy side (content type related)?

@ghostbuster91
Copy link
Contributor Author

Have you checked this with the latest changes on the alloy side (content type related)?

Yes, twice.

@kubukoz
Copy link
Member

kubukoz commented Jun 5, 2024

Scripted test failing due to a mismatch of the Alloy version btw

@ghostbuster91 ghostbuster91 requested review from kubukoz and Baccata June 12, 2024 09:37
@Baccata Baccata merged commit 8e1ee57 into disneystreaming:series/0.18 Jun 19, 2024
11 checks passed
@ghostbuster91 ghostbuster91 deleted the default-payload branch June 19, 2024 22:11
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.

Support @default on payloads?
3 participants