مواصفة OpenAPI
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
read an OpenAPI document.
الموضوعات المخطط لها
- OpenAPI is a standard, machine-readable description of an HTTP API, written in YAML or JSON.
infonames the API and its version.serverslists base URLs.pathslists URLs; each path has operations (get,post, ...).- An operation lists parameters, a request body, and
responsesby status code. - Reusable shapes live in
components/schemasand are referenced with$ref.
تفاصيل المخطط المبدئي
عرض عملي
openapi: 3.0.3
info: { title: Shop API, version: 1.0.0 }
paths:
/products/{id}:
get:
parameters:
- { name: id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: OK }
"404": { description: Not found }اختبر فهمك
Where do reusable schemas live?
أظهر الإجابة
Under components/schemas.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.