Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jvandaele opened this issue Jan 4, 2024 · 1 comment
Open

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

jvandaele opened this issue Jan 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jvandaele
Copy link

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.

@jvandaele jvandaele added the bug Something isn't working label Jan 4, 2024
@shulard
Copy link
Member

shulard commented Jan 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants