CirceCursor.asLeaf incorrectly validates primitive json values
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start at CirceCursor.asLeaf and use the linked Scastie reproduction to observe how a primitive JSON value is handled for a String! field. The issue is done when primitive values are validated against the declared field type rather than returned as valid output, while the reproduction continues to behave correctly.
Written by the indexing model from the issue text.
Description
Case branch for custom scalars, added in https://github.com/typelevel/grackle/commit/2ccc7e175b01dac83ac6fdbefe710fa3794fc99a, broke validation of primitive values against field type
Reproduction
https://scastie.scala-lang.org/ztqartpFRD2mliztvGixpQ
import cats.effect.SyncIO
import grackle.Schema
import grackle.circe.CirceMapping
import grackle.syntax._
object Repro extends CirceMapping[SyncIO] {
override val schema: Schema =
schema"""
type Query {
value: String!
}
"""
override val typeMappings: Repro.TypeMappings = List(
ObjectMapping(schema.ref("Query"))(
CirceField("value", io.circe.Json.fromInt(42))
)
)
}
println(Repro.compileAndRun("{ value }").unsafeRunSync()) // { "data": { "value": 42 } }
- Dominant language
- Scala
- Stars
- 189
- Forks
- 32
- Avg merge
- 14h 48m
- Merged PRs (30d)
- 25
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from typelevel/grackle
-
Add http(4s) moduleOpen
Difficulty 5/5 Over a week Newbie friendliness 28/100
typelevel/grackle#946 · 1 comment ·
Maintainers usually reply within 1 day
-
conformance
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
bug
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
All issues in typelevel/grackle
Similar issues
-
Files.createDirectories throws a bare IOException when another process creates the directory firstOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
scala-native/scala-native#5077 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
arrays_zip with two same-named inputs fails with "ArrowArray struct has 2 children (expected 1)"Openbug requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/datafusion-comet#6251 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ergoplatform/ergo#2579 ·
Maintainers usually reply within 2 days
-
x:action/improve x:size/tiny x:type/content
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day