Skip to content

Wrong JSON defaults on petition creation #31

@uladribia

Description

@uladribia

Current fields throw a malformatted JSON error on credential creation.

Fields by default should be:

(Note that $credential_URL and $petitions_URL should be filled automatically from the settings written in the configuration of the petitions module and $random_string should be a random string)

Field 1

{
  "mandatory": [
    {
      "name": {
        "ca": "NOM A MOSTRAR PER LA CREDENCIAL A LA APP",
        "en": "CREDENTIAL NAME TO SHOW IN APP",
        "es": "NOMBRE A MOSTRAR PARA LA CREDENCIAL DE LA APP"
      },
      "provenance": {
        "url": "$credential_URL",
        "issuerName": {
          "ca": "NOM A MOSTRAR DE L'EMISSOR DE CREDENCIALS A LA APP",
          "en": "CREDENTIAL ISSUER NAME TO SHOW IN APP",
          "es": "NOMBRE A MOSTRAR DEL EMISSOR DE CREDENCIALES A LA APP"
        },
        "petitionsUrl": "$petitions_URL"
      },
      "verificationInput": [
        {
          "id": "CHALLENGE_NAME",
          "name": {
            "ca": "NOM DEL CHALLENGE A MOSTRAR A LA APP",
            "en": "CHALLENGE NAME TO SHOW IN APP",
            "es": "NOMBRE DEL CHALLENBGE A MOSTRAR EN AL APP"
          },
          "type": "string"
        }
      ]
    }
  ]
}

Field 2

Note that CHALLENGE_NAME should be the same as the earlier CHALLENGE_NAME field.

[
  {
    "name": "CHALLENGE_NAME",
    "type": "str",
    "value_set": [
      "a_password",
      $random_string,
    ]
  }
]

Field 3

[
  {
    "k": 2,
    "name": "age",
    "type": "str",
    "value_set": [
      "0-19",
      "20-29",
      "30-39",
      ">40"
    ]
  },
  {
    "k": 2,
    "name": "gender",
    "type": "str",
    "value_set": [
      "F",
      "M",
      "O"
    ]
  },
  {
    "k": 2,
    "name": "district",
    "type": "str",
    "value_set": [
      "1",
      "2",
      "3",
      "4",
      "5",
      "6",
      "7",
      "8",
      "9",
      "10"
    ]
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions