Symfony

API Platform

API Platform REST orchestration: resources, JSON-LD, serialization groups, filters, pagination, custom operations, OpenAPI

22 คำถามสัมภาษณ์·
Mid-Level
1

What is API Platform in the Symfony ecosystem?

คำตอบ

API Platform is an open-source framework dedicated to creating REST and GraphQL APIs. It integrates natively with Symfony and automatically generates OpenAPI documentation, an admin interface, and CRUD endpoints from Doctrine entities. This approach significantly reduces API development time.

2

How to expose a Doctrine entity as an API Platform resource?

คำตอบ

To expose an entity as an API Platform resource, simply add the #[ApiResource] attribute to the entity class. This attribute tells API Platform to automatically generate CRUD endpoints (GET, POST, PUT, PATCH, DELETE) for this entity. No manual route configuration is required.

3

What data format does API Platform use by default for REST responses?

คำตอบ

API Platform uses JSON-LD (JSON for Linked Data) by default. This format enriches JSON with semantic metadata describing relationships between resources, data types, and hypermedia links. This facilitates interoperability and automatic API discovery by clients.

4

How to limit the available operations on an API Platform resource?

5

What is the purpose of serialization groups in API Platform?

+19 คำถามสัมภาษณ์

เชี่ยวชาญ Symfony สำหรับการสัมภาษณ์ครั้งถัดไป

เข้าถึงคำถามทั้งหมด flashcards แบบทดสอบเทคนิค แบบฝึกหัด code review และตัวจำลองสัมภาษณ์

เริ่มใช้ฟรี