Advertisement
secumbu

JSON Validierung Beispiel

Jan 15th, 2024
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 1.12 KB | None | 0 0
  1. {
  2.   "type": "object",
  3.   "properties": {
  4.     "userId": {
  5.       "type": "integer"
  6.     },
  7.     "vorname": {
  8.       "type": "string",
  9.       "maxLength": 50
  10.     },
  11.     "nachname": {
  12.       "type": "string",
  13.       "maxLength": 50
  14.     },
  15.     "email": {
  16.       "type": "string",
  17.       "format": "email"
  18.     },
  19.     "benutzername": {
  20.       "type": "string",
  21.       "minLength": 3,
  22.       "maxLength": 20
  23.     },
  24.     "geburtsdatum": {
  25.       "type": "string",
  26.       "format": "date"
  27.     },
  28.     "aktiv": {
  29.       "type": "boolean"
  30.     },
  31.     "adresse": {
  32.       "type": "object",
  33.       "properties": {
  34.         "strasse": {
  35.           "type": "string"
  36.         },
  37.         "hausnummer": {
  38.           "type": "string"
  39.         },
  40.         "stadt": {
  41.           "type": "string"
  42.         },
  43.         "postleitzahl": {
  44.           "type": "string",
  45.           "pattern": "^[0-9]{4,5}$"
  46.         },
  47.         "land": {
  48.           "type": "string"
  49.         }
  50.       },
  51.       "required": ["strasse", "stadt", "postleitzahl", "land"]
  52.     }
  53.   },
  54.   "required": ["userId", "vorname", "nachname", "email", "benutzername", "geburtsdatum", "aktiv"]
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement