Skip to content

The ValidateUntrusted examples in the readme appear to be incorrect #1

Description

@davidkuster

In the ValidateUntrusted examples, these two code samples are the same but one indicates it should work and one indicates it should throw an exception:

    // Returns: true
    validateUntrusted(
      gson.fromJson("{ \"type\": \"string\" }", Schema.class),
      new GsonAdapter(gson.fromJson("\"foo\"", JsonElement.class)));

    // Raises:
    //
    // com.jsontypedef.jtd.InvalidSchemaException: ref to non-existent definition
    validateUntrusted(
      gson.fromJson("{ \"type\": \"string\" }", Schema.class),
      new GsonAdapter(gson.fromJson("\"foo\"", JsonElement.class)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions