DECODEproject / DECODEproject/decidim-module-petitions

Wrong JSON defaults on petition creation

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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
```json
{
"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.
```json
[
{
"name": "CHALLENGE_NAME",
"type": "str",
"value_set": [
"a_password",
$random_string,
]
}
]
```

# Field 3

```json
[
{
"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"
]
}
]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.