Open kimxogus opened 5 years ago
Hey @kimxogus, thanks for the report!
It's somewhat alarming that this doesn't work, as https://github.com/twilio/guardrail/blob/3066dfd6b456ed2c9964831407cc743a7965b8af/modules/codegen/src/main/scala/com/twilio/guardrail/generators/ScalaParameter.scala#L98-L99 would otherwise suggest that the functionality should be supported. Would you be available to dig in a bit and figure out why this isn't working as designed?
As a workaround, I'd expect
- name: Cookie
in: header
schema:
type: string
and putting s"_session=${cookieEscapedValue}"
as the header value would at the very least unblock you
@blast-hardcheese My guess is this doesn't work because we just don't do anything with the cookie params in the actual code generators. https://github.com/twilio/guardrail/blob/master/modules/codegen/src/main/scala/com/twilio/guardrail/generators/ScalaParameter.scala#L18-L22 suggests that we don't even look at them, and I don't see any specific cookie handling in the codegen.
@kelnos Yes, it seems that cookie params are not handled in https://github.com/twilio/guardrail/blob/master/modules/codegen/src/main/scala/com/twilio/guardrail/generators/ScalaParameter.scala#L18-L22 and all generators(akka, https in both java and scala)
https://swagger.io/docs/specification/describing-parameters/#cookie-parameters
I generated scala
akka-http
routes with cookie parameterBut cookie parameter is not shown in generated code.