SlideShare a Scribd company logo
Symfony ile Gelişmiş
API Mimarisi
Behram ÇELEN
Software Developer
github.com/behramcelen
twitter.com/behramcelen
behramcelen@gmail.com
API
● Application Programming
Interface
● REST
● Facebook/Twitter.. API
● Postman
● Swagger
● RESTful API
● JSON and XML
● Versioning
Symfony
Bundles
● FOSRestBundle
● NelmioApiDocBundle
https://github.com/FriendsOfSymfony/FOSRestBundle
https://github.com/nelmio/NelmioApiDocBundle
API Methods
● GET
● POST
● PUT
● PATCH
● DELETE
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
GET
● Değişikliğe neden
olmamalı
● Cache Kullanılabilir
● Resource veya Resource
Collection dönmeli
● Offset ve Limit olmalı
(Collection için)
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3
POST
● Resource create
● Validation
● Hata veya resource location
dönmeli
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5
PUT
● Create resource if not
exists
● Validation
● Eğer resource varsa
güncellemeli
● Yoksa resource u
oluşturmalı
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6
PATCH
● Resource yoksa 404
dönmeli
● Validation
● Resource un belirli
fieldları
güncellenebilir
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6
DELETE
● Resource yoksa 404
dönmeli
● Resource varsa
silinmeli
● NULL content dönmeli
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7
FOSRestBundle
● Kurulum
● JMSSerializerBundle
● Handlers
● Routing
http://symfony.com/doc/master/bundles/FOSRestBundle/1-
setting_up_the_bundle.html
http://jmsyst.com/libs/serializer
https://github.com/ojs/ojs/tree/master/src/Ojs/ApiBundle/Handler
https://github.
com/ojs/ojs/blob/master/src/Ojs/ApiBundle/Resources/config/routing_
rest.yml
NelmioApiDoc
Bundle
● Swagger Doc Support
● View Layer
● Annotation
● Commands
● HTML, Markdown, JSON do
dump
● Sandbox Support
https://github.
com/nelmio/NelmioApiDocBundle/blob/master/Resources/doc/index.
rst
https://github.
com/ojs/ojs/blob/master/src/Ojs/ApiBundle/Controller/Journal/Journal
ArticleAuthorRestController.php#L150
Routing
https://github.com/ojs/ojs/blob/master/app%2Fconfig%2Frouting_rest.yml
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FResources%2Fconfig%2Frouting_rest.yml
Security
● ACL
● ApiKey Auth
Related Links
https://github.com/ojs/ojs/blob/master/app/config/security.yml#L20
https://github.com/ojs/ojs/blob/a8f11d6b7fd351a837a21ece92f487a3ca978d71/app/config/services.yml#L14
https://github.com/ojs/ojs/blob/master/src/Ojs/ApiBundle/Security/ApiKeyUserProvider.php#L20
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FSecurity%2FApiKeyAuthenticator.php#L16
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FController%2FAdmin%2FArticleTypeRestController.php#L44
Handlers
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FResources%2Fconfig%2Fservices.yml
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FHandler%2FArticleTypeHandler.php
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FController%2FAdmin%2FArticleTypeRestController.php#L129
Exception
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FException%2FInvalidFormException.php
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FController%2FAdmin%2FArticleTypeRestController.php#L45
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FController%2FAdmin%2FArticleTypeRestController.php#L277
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FSecurity%2FApiKeyAuthenticator.php#L31
Validation
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FHandler%2FArticleTypeHandler.php#L119
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FAdminBundle%2FForm%2FType%2FArticleTypesType.php
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FJournalBundle%2FResources%2Fconfig%2Fvalidation%2FJournal.yml
Serializer
http://jmsyst.com/libs/serializer
http://jmsyst.com/libs/serializer/master/reference/annotations
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FJournalBundle%2FEntity%2FArticle.php#L26
Tests
https://github.com/ojs/ojs/tree/master/src/Ojs/ApiBundle/Tests/Controller
File Upload
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FTests%2FController%2FJournalIssueRestControllerTest.
php#L25
https://github.com/ojs/ojs/blob/master/src%2FOjs%2FApiBundle%2FHandler%2FJournalIssueHandler.php#L162
Teşekkürler
behramcelen@gmail.com

More Related Content

PDF
KAK Etkinliği OJS de Symfony kullanımı
PDF
meet.php #11 - Huston, we have an airbrake
PDF
OpenCms Days 2013 - Site Management Tool
PDF
Dependency management in Magento with Composer
PDF
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
PDF
DevHub 3 - Composer plus Magento
PDF
CPAN Packager
PDF
CPAN Packager
KAK Etkinliği OJS de Symfony kullanımı
meet.php #11 - Huston, we have an airbrake
OpenCms Days 2013 - Site Management Tool
Dependency management in Magento with Composer
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
DevHub 3 - Composer plus Magento
CPAN Packager
CPAN Packager

What's hot (19)

PDF
How composer saved PHP
KEY
SimpleTestによるPHPのテスト
PDF
OpenCms Days 2015 Workflow using Docker and Jenkins
PDF
The Installer - BarCamp - Meet Magento 2014 Germany
PDF
Joomlatools Platform v2.0
PDF
Automated Releases to RubyGems.org using Travis-CI.org
PDF
Chromium: NaCl and Pepper API
PPTX
Websockets
ODP
Perl ides
PDF
OpenCms Days 2014 - Updating to OpenCms 9.5
PPTX
New EEA Plone Add-ons
PDF
Extensible web #html5j
PDF
PHP client - Mongo db User Group Pune
PDF
Making CLIs with Node.js
PDF
ORTC SVC SimulCast
PDF
Magento 2 Capistrano Deploy
PDF
Building com Phing - 7Masters PHP
PPT
Introduction to composer
ODP
How composer saved PHP
SimpleTestによるPHPのテスト
OpenCms Days 2015 Workflow using Docker and Jenkins
The Installer - BarCamp - Meet Magento 2014 Germany
Joomlatools Platform v2.0
Automated Releases to RubyGems.org using Travis-CI.org
Chromium: NaCl and Pepper API
Websockets
Perl ides
OpenCms Days 2014 - Updating to OpenCms 9.5
New EEA Plone Add-ons
Extensible web #html5j
PHP client - Mongo db User Group Pune
Making CLIs with Node.js
ORTC SVC SimulCast
Magento 2 Capistrano Deploy
Building com Phing - 7Masters PHP
Introduction to composer
Ad

Similar to Symfony ile Gelişmiş API Mimarisi (20)

PDF
Building APIs in an easy way using API Platform
PDF
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
PDF
REST easy with API Platform
PDF
Building a documented RESTful API in just a few hours with Symfony
PDF
API Platform: Full Stack Framework Resurrection
PDF
KAK Etkinliği OJS de Symfony kullanımı
PDF
API Platform and Symfony: a Framework for API-driven Projects
PDF
Creating a modern web application using Symfony API Platform, ReactJS and Red...
PDF
Why we choose Symfony2
PDF
Creating a modern web application using Symfony API Platform Atlanta
PDF
Sep Nasiri "Upwork PHP Architecture"
PDF
High quality ap is with api platform
PDF
Building APIs in an easy way using API Platform
PDF
Some tips to improve developer experience with Symfony
PDF
Using API Platform to build ticketing system #symfonycon
PPTX
PHP Symfony MicroServices Migration @MeeticTech
KEY
The use of Symfony2 @ Overblog
PDF
REST in pieces
PDF
[drupalday2017] - REST in pieces
PDF
API platform and how to use it
Building APIs in an easy way using API Platform
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
REST easy with API Platform
Building a documented RESTful API in just a few hours with Symfony
API Platform: Full Stack Framework Resurrection
KAK Etkinliği OJS de Symfony kullanımı
API Platform and Symfony: a Framework for API-driven Projects
Creating a modern web application using Symfony API Platform, ReactJS and Red...
Why we choose Symfony2
Creating a modern web application using Symfony API Platform Atlanta
Sep Nasiri "Upwork PHP Architecture"
High quality ap is with api platform
Building APIs in an easy way using API Platform
Some tips to improve developer experience with Symfony
Using API Platform to build ticketing system #symfonycon
PHP Symfony MicroServices Migration @MeeticTech
The use of Symfony2 @ Overblog
REST in pieces
[drupalday2017] - REST in pieces
API platform and how to use it
Ad

Recently uploaded (20)

PDF
Lecture1 pattern recognition............
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
Introduction to machine learning and Linear Models
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Database Infoormation System (DBIS).pptx
PDF
Clinical guidelines as a resource for EBP(1).pdf
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PDF
Foundation of Data Science unit number two notes
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPT
Quality review (1)_presentation of this 21
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
IB Computer Science - Internal Assessment.pptx
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Lecture1 pattern recognition............
Fluorescence-microscope_Botany_detailed content
IBA_Chapter_11_Slides_Final_Accessible.pptx
Introduction to machine learning and Linear Models
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Database Infoormation System (DBIS).pptx
Clinical guidelines as a resource for EBP(1).pdf
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Foundation of Data Science unit number two notes
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Reliability_Chapter_ presentation 1221.5784
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Quality review (1)_presentation of this 21
Galatica Smart Energy Infrastructure Startup Pitch Deck
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
IB Computer Science - Internal Assessment.pptx
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx

Symfony ile Gelişmiş API Mimarisi