Skip to content

nullable subjson #133

Description

@Kleinast

Hi,

Is there a way to match that json property can be an object matching my matcher AND can also be null:

{
  "id": "@integer@",
  "title": "@string@",
  "image": {
    "title": "@string@",
    "alt": "@string@",
    "url": "@string@.isUrl()"
  },
  "content": "@string@",
  "description": "@string@",
  "cookTime": "@integer@",
  "preparationTime": "@integer@",
  "coverNumber": "@integer@",
  "ingredients": "@string@",
  "type": "recipe"
}

But my image object can be null like this:

{
  "id": "@integer@",
  "title": "@string@",
  "image": null,
  "content": "@string@",
  "description": "@string@",
  "cookTime": "@integer@",
  "preparationTime": "@integer@",
  "coverNumber": "@integer@",
  "ingredients": "@string@",
  "type": "recipe"
}

Thanks for your help

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions