function JsonApiSpec::isValidMemberName
Checks whether the given member name is valid.
Requirements:
- it MUST contain at least one character.
- it MUST contain only the allowed characters
- it MUST start and end with a "globally allowed character"
Parameters
string $member_name: A member name to validate.
Return value
bool Whether the given member name is in compliance with the JSON:API specification.
See also
http://jsonapi.org/format/#document-member-names
1 call to JsonApiSpec::isValidMemberName()
- JsonApiSpec::isValidCustomQueryParameter in core/
modules/ jsonapi/ src/ JsonApiSpec.php - Checks whether the given custom query parameter name is valid.
File
-
core/
modules/ jsonapi/ src/ JsonApiSpec.php, line 86
Class
- JsonApiSpec
- Defines constants used for compliance with the JSON:API specification.
Namespace
Drupal\jsonapiCode
public static function isValidMemberName($member_name) {
return preg_match(static::MEMBER_NAME_REGEXP, $member_name) === 1;
}