Ir al contenido principal
Versión: 5.3.x

JSON

[Traducción Beta No Oficial]

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Comparadores básicos

MatcherDescriptionTargets
shouldBeValidJsonverifies that a given string parses to valid jsonMultiplatform
shouldBeJsonObjectasserts that a string is a valid JSON objectMultiplatform
shouldBeJsonArrayasserts that a string is a valid JSON arrayMultiplatform

Comparación basada en contenido

Para más detalles, consulta aquí o sigue los enlaces específicos de cada comparador a continuación

MatcherDescriptionTargets
shouldEqualJsonVerifies that a String matches a given JSON structure.Multiplatform
shouldEqualSpecifiedJsonVerifies that a String matches a given JSON structure, but allows additional unspecified properties.Multiplatform
shouldContainJsonKeyVerifies that a String is JSON, and contains a given JSON pathJVM
shouldContainJsonKeyValueVerifies that a String is JSON, and contains a given JSON path with the specified valueJVM
shouldMatchJsonResourceVerifies that a String is matches the JSON content of a given test resourceJVM

Validación de esquema

MatcherDescriptionTargets
shouldMatchSchemaValidates that a String or kotlinx.serialization.JsonElement matches a JsonSchema. See description below for details on constructing schemas.Multiplatform