I created a custom endpoints by extending the core of Drupal. but I can not retrieve JSON data. I do not know what value to put in ‘note: serialization_class
/** * Provides a resource to get bundles by entity. * * @RestResource( * id = "dna_custom_endpoint", * label = @Translation("DNA custom endpoint"), * serialization_class = ??????, * uri_paths = { * "canonical" = "/dnarest/{type}" * } * ) */
You know comprehensive guides that explain?
public function patch($type = 'type') { ??????? }
if you use what you said ( serialization_class = “DrupalCoreEntityEntity”,) to me this generates fatal error PHP :
DrupalCoreEntityExceptionNoCorrespondingEntityClassException: The DrupalCoreEntityEntity class does not correspond to an entity type. in DrupalCoreEntityEntityTypeRepository->getEntityTypeFromClass() (line 103 of /Applications/MAMP/htdocs/dnaphone/core/lib/Drupal/Core/Entity/EntityTypeRepository.php).