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

Multipart encoding validation only checks against a single content type #134

Closed
jimcottrell opened this issue Jul 12, 2021 · 1 comment · Fixed by #135
Closed

Multipart encoding validation only checks against a single content type #134

jimcottrell opened this issue Jul 12, 2021 · 1 comment · Fixed by #135

Comments

@jimcottrell
Copy link

According to the OpenAPI spec for the Encoding object's contentType field (this also exists in a comment in MultipartValidator::detectEncondingContentType():

The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types

The multipart validation as it currently exists only validates against contentType as a single entry, failing if contentType is defined as a comma-separated list.

I'll submit a PR for this.

@dwilmer-karify
Copy link

I recently ran into this issue as well. I see that there is a pull request ready, but I'm unfamiliar with the process. What would be the next step towards getting it accepted?

jimcottrell pushed a commit to jimcottrell/openapi-psr7-validator that referenced this issue Jan 28, 2023
janmaennig added a commit to janmaennig/openapi-psr7-validator that referenced this issue Jul 31, 2023
* 'master' of github.com:thephpleague/openapi-psr7-validator: (47 commits)
  Drop test for valid epsilon
  Add use statement for round
  Use epsilon to compare floating points
  Fix type errors
  Unignore phpstan errors, fixed now. Add polyfill 8.0 for `str_starts_with`
  Fix tests for boolean validation
  Fix string-to-boolean casting
  Handle path parameters for arrays correctly
  Add getVerboseMessage to AddressValidationFailed exception
  Fix test notice
  Fix content type parameter comparison
  (thephpleague#134) Add support for comma-separated list of encoding content types
  Fix cs errors. Use PHP 7.2 as phpstan reference language version to avoid false positive errors
  PathFinder: Adding filtering of placeholder routes scored by matching parts count
  Also remove check from multi-part server request validation
  Use devizzent/cebe-php-openapi to be compatible with OpenApi 3.1
  Allow specifying encoding for optional parts of multipart data without validation errors
  Temporary silence phpstan for checking type of magic props
  Fix codestyle
  Access operation security element directly, avoiding getSerializableData()
  ...

# Conflicts:
#	src/PSR7/Validators/BodyValidator/MultipartValidator.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants