Skip to content

nullable subjson #133

Closed
Closed
@Kleinast

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

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