Skip to content

Commit

Permalink
W-11778938: Fix null value location
Browse files Browse the repository at this point in the history
  • Loading branch information
hghianni committed Oct 18, 2022
1 parent e279ec8 commit 530418f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Level: Violation
Severity: Violation
Target:
Property:
Range: [(16,25)-(16,26)]
Range: [(15,39)-(16,25)]
Location: file://amf-cli/shared/src/test/resources/validations/null-value-json.raml

- Constraint: http://a.ml/vocabularies/amf/core#syaml-error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package amf.validation

import amf.apicontract.client.scala.RAMLConfiguration
import amf.core.client.common.validation.{Raml08Profile, Raml10Profile}
import amf.core.client.scala.config.ParsingOptions
import amf.core.internal.remote.{Hint, Raml08YamlHint, Raml10YamlHint}

class RamlModelUniquePlatformReportTest extends UniquePlatformReportGenTest {
Expand Down Expand Up @@ -173,7 +175,8 @@ class RamlModelUniquePlatformReportTest extends UniquePlatformReportGenTest {
test("Test null value in json when expecting scalar value") {
validate(
"/null-value-json.raml",
Some("null-value-json.report")
Some("null-value-json.report"),
configOverride = Some(RAMLConfiguration.RAML08().withParsingOptions(ParsingOptions().withTokens))
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object InlineJsonSchemaParser extends JsonParsing with ScopedJsonContext with Er
ctx: ShapeParserContext
): AnyShape = {

val node = getJsonParserFor(text, valueAST).document().node
val node = getJsonParserFor(text, valueAST).document(ctx.parsingOptions.tokens).node
val schemaEntry = YMapEntry(key, node)
val shape = withScopedContext(valueAST, schemaEntry) { jsonSchemaContext =>
parse(value, schemaEntry)(jsonSchemaContext)
Expand Down

0 comments on commit 530418f

Please sign in to comment.