guardrail-dev / guardrail-dev/guardrail
Produces/Consumes media type does not support parameters (rfc6838)
Open
core
enhancement
good first issue
help wanted
- Dominant language
- Scala
- Stars
- 541
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
In a spec, specifying `produces` and `consumes` with media type [parameters](https://tools.ietf.org/html/rfc6838#section-4.3) generates broken code (does not compile).
Example:
```
consumes:
- application/json;foo=bar
produces:
- application/json;baz=bat
```
I am guessing [that the `ApplicationJson` check](https://github.com/twilio/guardrail/blob/master/modules/codegen/src/main/scala/com/twilio/guardrail/generators/Scala/Http4sHelper.scala#L64-L97) could maybe be changed to use `exists` with a predicate that matches against the start of the string? I can open a PR if need be to illustrate/fix.
Contributor guide
Assessment
This issue has not been assessed yet.