Skip to content

Raven don't accept arrays with "abstract" values. #26

@jvandaele

Description

@jvandaele

Describe the bug
Raven don't accept arrays with "abstract" values.

To Reproduce
Let's take a generic OpenAPI documentation like this one :

post:
  operationId: action
  tags:
    - Action
  summary: Doing an action.
  responses:
    202:
      description: Successfully created the corresponding job.
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/Job'

Job:
  type: object
  required:
    - id
    - type
    - attributes
  properties:
    type:
      type: string
    id:
      type: integer
    attributes:
      properties:
        title:
          type: string
          example: "Job"
        metadatas:
          type: array
          items:
            type: string

Here, we don't want to specify the content of the "metadatas".
However, when running a successful test on that API point, Raven isn't happy, as it's excepting "metadatas" to be described in the documentation, here's an example of an error :

Data validation failed for property "data.attributes.metadatas", invalid value: array (
  'download_url' => '/download-export/c988851c-8f9c-44fa-9cef-22ce18644d89',
  'download_size' => 7807,
  'export_type' => 'browse',
)

> Value expected to be 'array', 'array' given.

This error appear even when the "valuesNeedsToMatch" doesn't contains the specified array (here "metadatas").
Here is the "valuesNeedsToMatch" of the test :

    valuesNeedsToMatch:
      "[data][type]": job
      "[data][attributes][title]": Job

Expected behavior
We expect Raven to ignore the properties in the "abstract" arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions