openfisca / openfisca-core

OpenFisca core engine. See other repositories for countries-specific code & data.
https://openfisca.org
GNU Affero General Public License v3.0
170 stars 75 forks source link

personne_de_reference is missing from OpenAPI spec endpoint #542

Closed guillett closed 7 years ago

guillett commented 7 years ago

Hi there!

I really enjoy OpenFisca, but I recently encountered an issue.

Here is what I did:

I went to https://api-test.openfisca.fr/spec created by #514. It is a great endpoint, I used it to validated object before they are sent to my Openfisca endpoint.

Here is what I expected to happen:

Here is what actually happened:

The Menage definition does not include personne_de_reference and additionalProperties is set to false.

Here is the extract of the Menage definition:

"Menage": {
    "additionalProperties": false,
    "properties": {
        "null": {
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "autres": {
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "charges_locatives": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "check_crds": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "check_csg": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "check_csk": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "coloc": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "depcom": {
            "additionalProperties": {
                "type": "String"
            },
            "type": "object"
        },
        "eligibilite_anah": {
            "additionalProperties": {
                "type": "Enumeration"
            },
            "type": "object"
        },
        "enfants": {
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "exonere_taxe_habitation": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "impots_directs": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "logement_chambre": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "loyer": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "niveau_de_vie": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "niveau_de_vie_initial": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "niveau_de_vie_net": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "nombre_enfants_majeurs_celibataires_sans_enfant": {
            "additionalProperties": {
                "type": "Integer"
            },
            "type": "object"
        },
        "participation_frais": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "residence_dom": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "residence_guadeloupe": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "residence_guyane": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "residence_martinique": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "residence_mayotte": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "residence_reunion": {
            "additionalProperties": {
                "type": "Boolean"
            },
            "type": "object"
        },
        "revenu_disponible": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "revenu_initial": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "revenu_net": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "statut_occupation_logement": {
            "additionalProperties": {
                "type": "Enumeration"
            },
            "type": "object"
        },
        "taxe_habitation": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "type_menage": {
            "additionalProperties": {
                "type": "Integer"
            },
            "type": "object"
        },
        "uc": {
            "additionalProperties": {
                "type": "Float"
            },
            "type": "object"
        },
        "zone_apl": {
            "additionalProperties": {
                "type": "Enumeration"
            },
            "type": "object"
        }
    },
    "type": "object"
}

Context

I identify more as a:

fpagnoux commented 7 years ago

Indeed, that's an issue ! Thanks @guillett

We'll fix that as soon as possible.

fpagnoux commented 7 years ago

I'm including a fix in #539.

The problem should be solve when the PR is reviewed and merged :)

guillett commented 7 years ago

@fpagnoux ๐Ÿ‘๐Ÿ‘๐Ÿ‘ Great thanks for this quick answer. Menage is also missing conjoint but hopefully #539 already fixes it.

MattiSG commented 7 years ago

@guillett #539 is merged. Can you please confirm that this issue was fixed? ๐Ÿ˜ƒ

guillett commented 7 years ago

Yes it is, many thanks Team OpenFisca! ๐Ÿ‘

However, I have a suggestion/remark: I am expecting menage.personne_de_reference to be a String rather than an String array. Same comment for menage.conjoint.

I will open another issue to discuss that point.