thephpleague / openapi-psr7-validator

It validates PSR-7 messages (HTTP request/response) against OpenAPI specifications
MIT License
528 stars 93 forks source link

Error: Value expected to be 'array', 'array' given #169

Open Thommusa opened 2 years ago

Thommusa commented 2 years ago

I get this error when I validate my response don't understand what is wrong here the part of definition schema: node.certificate.decoupled: type: object title: node certificate decoupled schema description: 'Describes the payload for ''node'' ''certificate'' entities with display: decoupled.' properties: presentation: type: string title: '"presentation" alias of field "body"' ATTESTATION_PSC: type: array items: $ref: '#/components/schemas/paragraph.certificate_role.decoupled'

paragraph.certificate_role.decoupled: type: object title: paragraph certificate_role decoupled schema description: 'Describes the payload for ''paragraph'' ''certificate_role'' entities with display: decoupled.' properties: TELECHARGEMENT: type: array items: $ref: '#/components/schemas/paragraph.button_download.decoupled' COURRIER: type: array items: $ref: '#/components/schemas/paragraph.button_mail.decoupled' presentation: type: string title: '"presentation" alias of field "field_text_long_format"' titre: type: string title: '"titre" alias of field "field_title"' the exception details:

Keyword: type, Breadcrumb: 0>ATTESTATION_PSC, Error: Value expected to be 'array', 'array' given.

jimcottrell commented 1 year ago

This is probably too late to do you any good. That message is a little confusing, but it looks like that exception could be thrown if given an associative array, so my assumption would be that. Maybe something with the way content was decoded, or how that array was put together; possibly as a result of using array_filter or a similar function.

dhaeckel commented 4 months ago

see issue #25 there is a PR pending for changeing this.