SlideShare a Scribd company logo
1 of 22
Download to read offline
Введение в REST API
Подходы к генерации API документации


               Oleg Zinchenko
             oleg@exercise.com
О себе

Symfony разработчик с 2009 года

TeamLead в Exercise.com

Продвигаю Symfony2 в массы




https://twitter.com/1cdecoder
https://github.com/cystbear
http://cystbear.tumblr.com/
Exercise.com
 Программы    Видео
 Питание      Советы тренера
 Упражнения   Френды, лайки




                               Oleg Zinchenko
REST

  REpresentational State Transfer
                           Передача состояний

   Over HTTP
   State-less
   Кеширование




                                                Oleg Zinchenko
REST

  ACTIONS (HTTP METHODS)
   GET
   POST
   PUT/PATCH
   DELETE




                           Oleg Zinchenko
REST

  RESTful web API

  GET      /api/v1/orders
  POST     /api/v1/orders
  GET      /api/v1/orders/12
  PUT      /api/v1/orders/12
  DELETE   /api/v1/orders/12
  GET      /api/v1/orders/12/delete   forbidden




                                              Oleg Zinchenko
Задача




         Oleg Zinchenko
Задача
{
    "firstName": "Иван",
      "lastName": "Иванов",
      "address": {
      "streetAddress": "Московское ш., 101, кв.101",
        "city": "Ленинград",
        "postalCode": 101101
    },
      "phoneNumbers": [
      "812 123-1234",
      "916 123-4567"]
}

<person>
 <firstName>Иван</firstName>
 <lastName>Иванов</lastName> <address>
  <streetAddress>Московское ш., 101, кв.101</streetAddress>
  <city>Ленинград</city>
  <postalCode>101101</postalCode>
 </address>

 <phoneNumbers>
  <phoneNumber>812 123-1234</phoneNumber>
  <phoneNumber>916 123-4567</phoneNumber>
 </phoneNumbers>
</person>

                                                              Oleg Zinchenko
Bundles


  FOSRestBundle
   FOSRest

  JMSSerializerBundle
    jms/metadata




                        Oleg Zinchenko
2 Kernels


 AppKernel
 ApiKernel
   Разный набор конфигов
   Разный набор бандлов




                           Oleg Zinchenko
authentication + authorization



        authentication + authorization




                                         Oleg Zinchenko
Authentication




                 http://www.xml.com/pub/a/2003/12/17/dive.html

                                                     Oleg Zinchenko
Serialization

 Serializer map
  DemoAcmeDocumentFood:
    exclusion_policy: ALL
    properties:
      calories:
         expose: true
      caloriesPerServing:
         expose: true
      caloriesPerGram:
         expose: true
      caloriesPerFluidOunce:
         expose: true
      measurement:
         expose: true
      servingOptions:
         expose: true
    callback_methods:
      pre_serialize: [prepareMeasurement, prepareServingOptions]




                                                                   Oleg Zinchenko
Serialization

 Object Handlers
  {
      "id": "4fb1fb87944c4c0e240004de",
      "slug": "minimalist-article",
      "title": "Minimalist article",
      "updated_at": "2012-05-15T09:45:26+0300",
      "summary": "Minimalist summary",
      "body": "Minimalist body",
      "main_image": "http://e.com/upl/art/thum/parrot.mobile_client_medium.v1.jpg"
  }




                                                                                     Oleg Zinchenko
Тестирование

Behat
Buzz + aka WebApiContext
 Scenario: /foods get list of food. Pagination supported.
   Given I authorized as: "fred"
   When I make "GET" request to the "/api/v1/foods"
   Then the response status code should be: "200"
   And the response body should be similar to JSON:
     """
     [{"id":"4fb1fb8f944c4c0e24000622","slug":"bittermelon-cooked-a… }]
     """




                                                                          Oleg Zinchenko
Документация

Hippo doc
Swagger
NelmioApiDocBundle




                     Oleg Zinchenko
Документация
Hippo doc




http://api.jirafe.com/

                         Oleg Zinchenko
Документация
Swagger
 apis: [{
   path: "/pet.{format}/{petId}",
   description: "Operations about pets",
   operations: [{
     httpMethod: "GET",
     nickname: "getPetById",
     responseClass: "Pet",
     parameters: [...]
     summary: "Find pet by its unique ID"
     notes: "Only Pets which you have permission to see will be returned",
     errorResponses: [...]
   }]
 }




http://swagger.wordnik.com/
                                                                             Oleg Zinchenko
Документация
Swagger




http://swagger.wordnik.com/
                              Oleg Zinchenko
Документация
   NelmioApiDocBundle
/**
 * This the documentation description of your method, it will appear
 * on a specific pane. It will read all the text until the first
 * annotation.
 *
 * @ApiDoc(
 * resource=true,
 * description="This is a description of your API method",
 * filters={
 *      {"name"="a-filter", "dataType"="integer"},
 *      {"name"="another-filter", "dataType"="string", "pattern"="(foo|bar) ASC|DESC"}
 * }
 * )
 */
public function getAction()
{
}




https://github.com/nelmio/NelmioApiDocBundle
                                                                             Oleg Zinchenko
Документация
 NelmioApiDocBundle




https://github.com/nelmio/NelmioApiDocBundle
                                               Oleg Zinchenko
Спасибо




          Вопросы?




                     Oleg Zinchenko

More Related Content

What's hot

Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015
Naresha K
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
Jeen Lee
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
Nobuo Danjou
 

What's hot (20)

Perkenalan ReasonML
Perkenalan ReasonMLPerkenalan ReasonML
Perkenalan ReasonML
 
Stanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet ModulesStanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet Modules
 
Nigel hamilton-megameet-2013
Nigel hamilton-megameet-2013Nigel hamilton-megameet-2013
Nigel hamilton-megameet-2013
 
Java libraries you can't afford to miss
Java libraries you can't afford to missJava libraries you can't afford to miss
Java libraries you can't afford to miss
 
Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015
 
Shell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAShell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEA
 
Play á la Rails
Play á la RailsPlay á la Rails
Play á la Rails
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
2010/7/31 LTの虎@LL Tiger
2010/7/31 LTの虎@LL Tiger2010/7/31 LTの虎@LL Tiger
2010/7/31 LTの虎@LL Tiger
 
Real time server
Real time serverReal time server
Real time server
 
Node child process
Node child processNode child process
Node child process
 
Asynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale ofAsynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale of
 
groovy & grails - lecture 2
groovy & grails - lecture 2groovy & grails - lecture 2
groovy & grails - lecture 2
 
clonehd01
clonehd01clonehd01
clonehd01
 
Elixir on Containers
Elixir on ContainersElixir on Containers
Elixir on Containers
 
Socket.IO
Socket.IOSocket.IO
Socket.IO
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 

Viewers also liked

Zend con practical-zf1-zf2-migration
Zend con practical-zf1-zf2-migrationZend con practical-zf1-zf2-migration
Zend con practical-zf1-zf2-migration
Clark Everetts
 

Viewers also liked (6)

Sunshine php practical-zf1-zf2-migration
Sunshine php practical-zf1-zf2-migrationSunshine php practical-zf1-zf2-migration
Sunshine php practical-zf1-zf2-migration
 
Moving a high traffic ZF1 Enterprise Application to SF2 - Lessons learned
Moving a high traffic ZF1 Enterprise Application to SF2 - Lessons learnedMoving a high traffic ZF1 Enterprise Application to SF2 - Lessons learned
Moving a high traffic ZF1 Enterprise Application to SF2 - Lessons learned
 
Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
Educação física e inglês (partes do corpo)
Educação física e inglês (partes do corpo)Educação física e inglês (partes do corpo)
Educação física e inglês (partes do corpo)
 
Zend con practical-zf1-zf2-migration
Zend con practical-zf1-zf2-migrationZend con practical-zf1-zf2-migration
Zend con practical-zf1-zf2-migration
 

Similar to Введение в REST API

Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr Pasich
Piotr Pasich
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POE
Thiago Rondon
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Pat Cito
 
JSON Fuzzing: New approach to old problems
JSON Fuzzing: New  approach to old problemsJSON Fuzzing: New  approach to old problems
JSON Fuzzing: New approach to old problems
titanlambda
 
Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]
Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]
Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]
Accumulo Summit
 

Similar to Введение в REST API (20)

REST with Eve and Python
REST with Eve and PythonREST with Eve and Python
REST with Eve and Python
 
Zabbix Console
Zabbix ConsoleZabbix Console
Zabbix Console
 
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
 
Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr Pasich
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POE
 
Diseño y Desarrollo de APIs
Diseño y Desarrollo de APIsDiseño y Desarrollo de APIs
Diseño y Desarrollo de APIs
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande...
APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande...APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande...
APIdays Zurich 2019 - Specification Driven Development for REST APIS Alexande...
 
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...
APIdays Helsinki 2019 - Specification-Driven Development of REST APIs with Al...
 
Apigee Console & eZ Publish REST
Apigee Console & eZ Publish RESTApigee Console & eZ Publish REST
Apigee Console & eZ Publish REST
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 
Denys Serhiienko "ASGI in depth"
Denys Serhiienko "ASGI in depth"Denys Serhiienko "ASGI in depth"
Denys Serhiienko "ASGI in depth"
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
JSON Fuzzing: New approach to old problems
JSON Fuzzing: New  approach to old problemsJSON Fuzzing: New  approach to old problems
JSON Fuzzing: New approach to old problems
 
Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]
Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]
Accumulo Summit 2015: Zookeeper, Accumulo, and You [Internals]
 
Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4
 
Asynchronous programming patterns in Perl
Asynchronous programming patterns in PerlAsynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
 

More from Oleg Zinchenko (8)

Oro meetup #4
Oro meetup #4Oro meetup #4
Oro meetup #4
 
Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)
 
Erlang (GeekTalks)
Erlang (GeekTalks)Erlang (GeekTalks)
Erlang (GeekTalks)
 
Welcome to Erlang
Welcome to ErlangWelcome to Erlang
Welcome to Erlang
 
Erlang/N2O at KNPMeetup 2015
Erlang/N2O at KNPMeetup 2015Erlang/N2O at KNPMeetup 2015
Erlang/N2O at KNPMeetup 2015
 
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
 
DDD on example of Symfony (Webcamp Odessa 2014)
DDD on example of Symfony (Webcamp Odessa 2014)DDD on example of Symfony (Webcamp Odessa 2014)
DDD on example of Symfony (Webcamp Odessa 2014)
 
PHP. Trends, implementations, frameworks and solutions
PHP. Trends, implementations, frameworks and solutionsPHP. Trends, implementations, frameworks and solutions
PHP. Trends, implementations, frameworks and solutions
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Введение в REST API

  • 1. Введение в REST API Подходы к генерации API документации Oleg Zinchenko oleg@exercise.com
  • 2. О себе Symfony разработчик с 2009 года TeamLead в Exercise.com Продвигаю Symfony2 в массы https://twitter.com/1cdecoder https://github.com/cystbear http://cystbear.tumblr.com/
  • 3. Exercise.com Программы Видео Питание Советы тренера Упражнения Френды, лайки Oleg Zinchenko
  • 4. REST REpresentational State Transfer Передача состояний Over HTTP State-less Кеширование Oleg Zinchenko
  • 5. REST ACTIONS (HTTP METHODS) GET POST PUT/PATCH DELETE Oleg Zinchenko
  • 6. REST RESTful web API GET /api/v1/orders POST /api/v1/orders GET /api/v1/orders/12 PUT /api/v1/orders/12 DELETE /api/v1/orders/12 GET /api/v1/orders/12/delete forbidden Oleg Zinchenko
  • 7. Задача Oleg Zinchenko
  • 8. Задача { "firstName": "Иван", "lastName": "Иванов", "address": { "streetAddress": "Московское ш., 101, кв.101", "city": "Ленинград", "postalCode": 101101 }, "phoneNumbers": [ "812 123-1234", "916 123-4567"] } <person> <firstName>Иван</firstName> <lastName>Иванов</lastName> <address> <streetAddress>Московское ш., 101, кв.101</streetAddress> <city>Ленинград</city> <postalCode>101101</postalCode> </address> <phoneNumbers> <phoneNumber>812 123-1234</phoneNumber> <phoneNumber>916 123-4567</phoneNumber> </phoneNumbers> </person> Oleg Zinchenko
  • 9. Bundles FOSRestBundle FOSRest JMSSerializerBundle jms/metadata Oleg Zinchenko
  • 10. 2 Kernels AppKernel ApiKernel Разный набор конфигов Разный набор бандлов Oleg Zinchenko
  • 11. authentication + authorization authentication + authorization Oleg Zinchenko
  • 12. Authentication http://www.xml.com/pub/a/2003/12/17/dive.html Oleg Zinchenko
  • 13. Serialization Serializer map DemoAcmeDocumentFood: exclusion_policy: ALL properties: calories: expose: true caloriesPerServing: expose: true caloriesPerGram: expose: true caloriesPerFluidOunce: expose: true measurement: expose: true servingOptions: expose: true callback_methods: pre_serialize: [prepareMeasurement, prepareServingOptions] Oleg Zinchenko
  • 14. Serialization Object Handlers { "id": "4fb1fb87944c4c0e240004de", "slug": "minimalist-article", "title": "Minimalist article", "updated_at": "2012-05-15T09:45:26+0300", "summary": "Minimalist summary", "body": "Minimalist body", "main_image": "http://e.com/upl/art/thum/parrot.mobile_client_medium.v1.jpg" } Oleg Zinchenko
  • 15. Тестирование Behat Buzz + aka WebApiContext Scenario: /foods get list of food. Pagination supported. Given I authorized as: "fred" When I make "GET" request to the "/api/v1/foods" Then the response status code should be: "200" And the response body should be similar to JSON: """ [{"id":"4fb1fb8f944c4c0e24000622","slug":"bittermelon-cooked-a… }] """ Oleg Zinchenko
  • 18. Документация Swagger apis: [{ path: "/pet.{format}/{petId}", description: "Operations about pets", operations: [{ httpMethod: "GET", nickname: "getPetById", responseClass: "Pet", parameters: [...] summary: "Find pet by its unique ID" notes: "Only Pets which you have permission to see will be returned", errorResponses: [...] }] } http://swagger.wordnik.com/ Oleg Zinchenko
  • 20. Документация NelmioApiDocBundle /** * This the documentation description of your method, it will appear * on a specific pane. It will read all the text until the first * annotation. * * @ApiDoc( * resource=true, * description="This is a description of your API method", * filters={ * {"name"="a-filter", "dataType"="integer"}, * {"name"="another-filter", "dataType"="string", "pattern"="(foo|bar) ASC|DESC"} * } * ) */ public function getAction() { } https://github.com/nelmio/NelmioApiDocBundle Oleg Zinchenko
  • 22. Спасибо Вопросы? Oleg Zinchenko