From 0532294fa6b21f3a9b9f52a3eeca9ded25b348fd Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 30 Nov 2020 15:40:13 +0100 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(-) diff --git a/passerelle/contrib/rsa13/models.py b/passerelle/contrib/rsa13/models.py index 4303418f..48e532c0 100644 --- a/passerelle/contrib/rsa13/models.py +++ b/passerelle/contrib/rsa13/models.py @@ -815,23 +815,26 @@ class RSA13Resource(BaseResource, HTTPResource): display_order=9, json_schema_response=response_schema( { - 'type': 'object', - 'required': [ - 'id', - 'contrat_id', - ], - 'properties': { - 'id': {'type': 'integer'}, - 'contrat_id': {'type': 'integer'}, - 'libelle': {'type': 'string'}, - 'date_preconisation': DATE_SCHEMA, - 'date_deb': DATE_SCHEMA, - 'date_fin': DATE_SCHEMA, - 'validation': { - 'enum': ['En cours', 'Oui', 'Non'], + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ + 'id', + 'contrat_id', + ], + 'properties': { + 'id': {'type': 'integer'}, + 'contrat_id': {'type': 'integer'}, + 'libelle': {'type': 'string'}, + 'date_preconisation': DATE_SCHEMA, + 'date_deb': DATE_SCHEMA, + 'date_fin': DATE_SCHEMA, + 'validation': { + 'enum': ['En cours', 'Oui', 'Non'], + }, + 'clos': OUI_NON_ENUM, }, - 'clos': OUI_NON_ENUM, - }, + } } ), ) -- 2.29.2