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

Update scalafmt-core to 3.7.17 #316

Merged
merged 3 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Scala Steward: Reformat with scalafmt 3.7.15
f7dccf8d205c1d4f9bd5dbbf9680a6b9d175b444

# Scala Steward: Reformat with scalafmt 3.7.17
cc4f48597d3151542ecec3c159159e1793926314
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
runner.dialect = scala3
version = 3.7.15
version = 3.7.17
maxColumn = 120
3 changes: 2 additions & 1 deletion core/src/main/scala/sttp/model/MediaType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ case class MediaType(
(range.charset == Wildcard || charset.forall(_.equalsIgnoreCase(range.charset))) &&
// #309: when the main or sub types are wildcard, not taking into account the parameters
// #3253 from tapir: checking the parameters only if they are present in the range
(range.mainType == Wildcard || range.subType == Wildcard || range.otherParameters.isEmpty || (range.otherParameters.size == 1 && range.otherParameters.contains("q")) || {
(range.mainType == Wildcard || range.subType == Wildcard || range.otherParameters.isEmpty || (range.otherParameters.size == 1 && range.otherParameters
.contains("q")) || {
// the q value needs to be ignored - it has a different purpose
val rangeParametersWithoutQ = range.otherParameters - "q"
// `otherParameters` needs to be fully equal to `range.otherParameters` (ignoring case)
Expand Down
6 changes: 5 additions & 1 deletion core/src/test/scala/sttp/model/MediaTypeTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ class MediaTypeTests extends AnyFlatSpec with Matchers with TableDrivenPropertyC
(MediaType.ApplicationJson, ContentTypeRange("application", "json", "*", EmptyParameters), true),
// the q parameter in the range should be ignored
(MediaType.ApplicationJson, ContentTypeRange("application", "json", "*", Map("q" -> "0.5")), true),
(MediaType.ApplicationJson.copy(otherParameters = Map("a" -> "1")), ContentTypeRange("application", "json", "*", Map("q" -> "0.5")), true),
(
MediaType.ApplicationJson.copy(otherParameters = Map("a" -> "1")),
ContentTypeRange("application", "json", "*", Map("q" -> "0.5")),
true
),
// range defines parameters, but they are not equal (ignoring case)
(MediaType.ApplicationJson, ContentTypeRange("application", "json", "*", Map("a" -> "1")), false),
(
Expand Down
Loading