open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
34 stars 25 forks source link

Import a Product from the PDC API to generate the basic form #1734

Open joeribekker opened 2 years ago

joeribekker commented 2 years ago

Thema / Theme

Admin

Omschrijving / Description

With the upcomming PDC API featuring Products with a ProductAanvraag containing a JSON schema, we can link a form to a Product. However, the PDC API is not done and there's more feature that are usefull when linking product.

So, for now, we just want to import a JSON schema, which will generate a basic Open Forms form!

Tasks

Added value / Toegevoegde waarde

No response

Aanvullende opmerkingen / Additional context

No response

joeribekker commented 2 years ago

Example schema:

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "required": [
    "kenteken",
    "postcode",
    "reden",
    "huisnummer"
  ],
  "title": "Het objecttype Melding Openbare Ruimte",
  "properties": {
    "kenteken": {
      "title": "Kenteken",
      "type": "string",
      "pattern": "^[A-Z0-9][A-Z0-9]?[A-Z0-9]?-[A-Z0-9][A-Z0-9]?[A-Z0-9]?-[A-Z0-9][A-Z0-9]?[A-Z0-9]?$",
      "description": "Kenteken van het voertuig waarvoor de aanvraag wordt gedaan.",
      "examples": [
        "XX-11-YY"
      ]
    },
    "reden": {
      "title": "Reden",
      "type": "string",
      "description": "Reden van deze aanvraag.",
      "examples": [
        "Parkeren bij werk"
      ],
      "enum": [
        "Parkeren bij werk",
        "Parkeren bij woning",
        "Parkeren voor ondersteuning/verzorging"
      ]
    },
    "zone": {
      "title": "Parkeerzones",
      "type": "array",
      "description": "Voor welke parkeerzones geldt deze vergunning?",
      "items": {
        "type": "string",
        "enum": [
          "Zone Centrum",
          "Zone Buitenwijk",
          "Zone Bla"
        ]
      }
    },
    "redenToelichting": {
      "title": "Reden toelichting",
      "type": "string",
      "maxLength": 1000,
      "description": "Licht uw reden toe.",
      "examples": [
        "Parkeren bij werk"
      ]
    },
    "postcode": {
      "title": "Postcode",
      "type": "string",
      "pattern": "^[0-9]{4}[A-Z]{2}$",
      "description": "Postcode van het adres waar het voertuig het dichtst bij in de buurt geparkeerd wordt.",
      "examples": [
        "1000AB"
      ]
    },
    "huisnummer": {
      "title": "Huisnummer",
      "type": "integer",
      "description": "Huisnummer van het adres waar het voertuig het dichtst bij in de buurt geparkeerd wordt.",
      "examples": [
        "1000AB"
      ]
    }
  },
  "additionalProperties": false
}