📋 محتويات الصفحة
📖 الوصف
Swagger هي مواصفات ومجموعة أدوات لوصف وتوثيق REST APIs. تتضمن Swagger Specification (OpenAPI)، Swagger UI، Swagger Editor، Swagger Codegen وغيرها. Swagger هي المعيار الصناعي لتصميم وبناء وتوثيق APIs في الشركات الكبرى.
🎯 يستخدم في
مجالات استخدام هذه الأداة
•
تصميم API specifications
•
توثيق API تلقائي
•
توليد SDKs (Client Libraries)
•
توليد API Mock Servers
•
Contract Testing
✨ المميزات
أبرز مميزات هذه الأداة
✓
Swagger UI تفاعلي
✓
Swagger Editor online
✓
Code Generation (40+ لغة)
✓
OpenAPI 3.0 compliant
✓
تكامل مع جميع اللغات
✓
Swagger Hub للمشاركة
✓
Contract Testing
⚠️ العيوب
نقاط يجب مراعاتها
×
قد يكون معقداً للمبتدئين
×
يحتاج صيانة للـ specs
×
UI قديم نسبياً
💻 مثال على الاستخدام
كيفية استخدام هذه الأداة
# openapi.yaml (OpenAPI 3.0)
openapi: 3.0.3
info:
title: Sample API
version: 1.0.0
description: A sample API
servers:
- url: https://api.example.com/v1
paths:
/users:
get:
summary: List all users
responses:
'200':
description: A list of users
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
post:
summary: Create a user
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewUser'
responses:
'201':
description: User created
components:
schemas:
User:
type: object
properties:
id:
type: integer
name:
type: string
email:
type: string
NewUser:
type: object
required:
- name
- email
properties:
name:
type: string
email:
type: string
📚 أدوات أخرى في API
قد يعجبك أيضاً