Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JsonApiSpec.php

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\jsonapi

Code

public static function isValidMemberName($member_name) {
    return preg_match(static::MEMBER_NAME_REGEXP, $member_name) === 1;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal