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

fix(validator): allow header deserialization #2

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

oliviersorine
Copy link

@oliviersorine oliviersorine commented Dec 6, 2024

This PR allows us to provide better header validation on complex header.

For header value which can be like "key1=value1,key2=value", it will be deserialize into

[
  "key1" => "value1",
  "key2" => "value2"
]

and then be correctly match with openapi declaration like:

    - name: Pagination
      in: header
      required: true
      style: simple
      explode: true
      schema:
        type: object
        required:
          - key1
          - key2
        properties:
          key1:
            type: integer
            example: 1
          key2:
            type: integer
            example: 10

Please note, part of the forked lib seems weird at first glance since some validators wait for array to check object type.
I will continue to look for more information as soon as possible.

@oliviersorine oliviersorine self-assigned this Dec 6, 2024
Copy link

@DotnDev DotnDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@oliviersorine oliviersorine merged commit 40387cc into master Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants