openfisca / openfisca-web-api

[DEPRECATED] Web API for OpenFisca
https://www.openfisca.fr/
GNU Affero General Public License v3.0
13 stars 11 forks source link

Axes et calculate #53

Closed cmnt closed 8 years ago

cmnt commented 8 years ago
        vm.scenario = {
            "scenarios": [{
                "period": {
                    "start": 2014,
                    "unit": "year"
                },

                "axes": [{
                    "count": 50,
                    "max": 10000,
                    "min": 0,
                    "name": "salaire_imposable"
                }],
                "test_case": {
                    "individus": [{
                        "id": "Personne Principale",
                        "salaire_imposable": 0,
                        "statmarit": 2
                    }, {
                        "id": "Personne Conjoint",
                        "salaire_imposable": 2
                    }],
                    "familles": [{
                        "id": "Famille 1",
                        "parents": ["Personne Principale", "Personne Conjoint"],
                        "enfants": []
                    }],
                    "foyers_fiscaux": [{
                        "id": "Déclaration d'impôt 1",
                        "declarants": ["Personne Principale", "Personne Conjoint"],
                        "personnes_a_charge": []
                    }],
                    "menages": [{
                        "id": "Logement principal 1",
                        "personne_de_reference": "Personne Principale",
                        "conjoint": "Personne Conjoint",
                        "enfants": []
                    }]
                }
            }],
            'variables': ['impo']
        };
cbenz commented 8 years ago

The trick was to add "output_format": "variables" to the JSON payload.

Test added, see ab08d61cc1c8816a0e9895faf6d982b63e764964

Doc updated https://github.com/openfisca/openfisca-gitbook/commit/b4bc39100817de7e7e7d5f7c1c8644e6d2bf563b