guardrail-dev / guardrail-dev/guardrail

Produces/Consumes media type does not support parameters (rfc6838)

Open
#796 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.