schematic-ipsum icon indicating copy to clipboard operation
schematic-ipsum copied to clipboard

"required" fields throw errors...

Open the-t-in-rtf opened this issue 10 years ago • 2 comments

Your tool is brilliant in that it submits values for all fields, which means it's always a valid record. That should mean that required fields aren't an issue, but unfortunately, the tool chokes on the syntax for required fields for both the v3 and v4 draft standards.

To test with v3 syntax:

{
  "$schema": "http://json-schema.org/draft-03/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "ipsum": "id"
    },
    "name": {
      "type": "string",
      "ipsum": "name"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "bio": {
      "type": "string",
      "ipsum": "sentence"
    },
    "age": {
      "type": "integer"
    },
    "avatar": {
      "type": "string",
      "ipsum": "small image"
      ,
      "required": true
    }
  }
}                

To test with v4 syntax:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "ipsum": "id"
    },
    "name": {
      "type": "string",
      "ipsum": "name"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "bio": {
      "type": "string",
      "ipsum": "sentence"
    },
    "age": {
      "type": "integer"
    },
    "avatar": {
      "type": "string",
      "ipsum": "small image"
    }
  },
  "required": ["avatar"]
}                

the-t-in-rtf avatar Sep 19 '14 08:09 the-t-in-rtf

+1 pls fix! Love the tool . . .

jewelsjacobs avatar Dec 17 '15 20:12 jewelsjacobs

+1 The tool can be more useful with the support for required

bjdash avatar Jul 11 '17 09:07 bjdash