Projet

Général

Profil

0001-rsa13-define-action-response-s-schema-as-an-array.patch

Benjamin Dauvergne, 30 novembre 2020 20:41

Télécharger (2,18 ko)

Voir les différences:

Subject: [PATCH 1/2] rsa13: define action response's schema as an array

 passerelle/contrib/rsa13/models.py | 35 ++++++++++++++++--------------
 1 file changed, 19 insertions(+), 16 deletions(-)
passerelle/contrib/rsa13/models.py
815 815
        display_order=9,
816 816
        json_schema_response=response_schema(
817 817
            {
818
                'type': 'object',
819
                'required': [
820
                    'id',
821
                    'contrat_id',
822
                ],
823
                'properties': {
824
                    'id': {'type': 'integer'},
825
                    'contrat_id': {'type': 'integer'},
826
                    'libelle': {'type': 'string'},
827
                    'date_preconisation': DATE_SCHEMA,
828
                    'date_deb': DATE_SCHEMA,
829
                    'date_fin': DATE_SCHEMA,
830
                    'validation': {
831
                        'enum': ['En cours', 'Oui', 'Non'],
818
                'type': 'array',
819
                'items': {
820
                    'type': 'object',
821
                    'required': [
822
                        'id',
823
                        'contrat_id',
824
                    ],
825
                    'properties': {
826
                        'id': {'type': 'integer'},
827
                        'contrat_id': {'type': 'integer'},
828
                        'libelle': {'type': 'string'},
829
                        'date_preconisation': DATE_SCHEMA,
830
                        'date_deb': DATE_SCHEMA,
831
                        'date_fin': DATE_SCHEMA,
832
                        'validation': {
833
                            'enum': ['En cours', 'Oui', 'Non'],
834
                        },
835
                        'clos': OUI_NON_ENUM,
832 836
                    },
833
                    'clos': OUI_NON_ENUM,
834
                },
837
                }
835 838
            }
836 839
        ),
837 840
    )
838
-