iron-bound-designs / wp-rest-api-schema-validator

Validate WP REST API requests using a complete JSON Schema validator.
https://timothybjacobs.com/2017/05/17/json-schema-and-the-wp-rest-api/
MIT License
12 stars 2 forks source link

NOTICE: PHP message: PHP Notice: Trying to access array offset on value of type null #5

Closed thefrosty closed 3 years ago

thefrosty commented 3 years ago

If a request isn't set (edge case) the value of content type doesn't exist.

NOTICE: PHP message: PHP Notice: Trying to access array offset on value of type null in /usr/local/wordpress/vendor/ironbound/wp-rest-api-schema-validator/src/Middleware.php on line 830

https://github.com/iron-bound-designs/wp-rest-api-schema-validator/blob/c5452e3ae972a13a1581a219c96c4cf1c81d5e60/src/Middleware.php#L830

thefrosty commented 3 years ago

So should the expectation be that if there is no content type, do we assume JSON?