matks / ApiCycle

Demo project for "Use Swagger to document a Symfony API" blog post
MIT License
11 stars 8 forks source link

How to get the current date-time? #12

Open zesanriky opened 5 years ago

zesanriky commented 5 years ago

My assignment is written as below:

Create RESTful API with swagger

  1. Development Symfony based application with RESTful API, Swagger documentation to demonstrate the API, one service to get the current date-time.

  2. RESTful service that sends the current date time from the browser-client to the server and logs it to the PSR-3 logger.

How can I using this repository to get done with number 1 and 2 ?

matks commented 5 years ago

Hi ! You can use this repository as an example on how to build 1. . For 2. it's not going to help you.

However since I built this example, there is a far better alternative now, and this is https://github.com/api-platform/api-platform. This is an API framework built on top of Symfony, and it provides a Swagger documentation as a native feature. If you are looking for the quickest way to build the Symfony API described in 1. it's this way I believe 😉.

zesanriky commented 5 years ago

Thanks a lot for your reply. I followed the example to meet the requirement 1 from here https://dev.to/mathieuks/use-swagger-to-document-a-symfony-api-790 and https://github.com/matks/ApiCycle/tree/master/apps/movies-api/tests/AppBundle/Controller. Am I right? Or Do I need to clone the whole repo and follow the "READ ME" to meet (1), How can I add "one service to get the current date-time." I have found something here https://github.com/symfony/symfony/issues/12178, anyway to integrate to your code possible?