Skip to content

Latest commit

 

History

History
131 lines (96 loc) · 3.28 KB

README.md

File metadata and controls

131 lines (96 loc) · 3.28 KB

Symfony 5 Proof of Concept Project

This project aims to demontrate a simple Rest Api implementation, Many-To-Many entities relationship, Symfony console command creation and CSV file importing.

Installation

Install symfony-api with docker-compose

  git clone git@github.com:diegoBSousa/symfony-api.git
  cd symfony-api
  docker-compose up -d

Importation Command

~$ symfony console app:import-posts ./file-name.csv

API Reference

Tag Entity

GET ALL TAGS

  GET /api/v1/tags?page=${page}&limit=${limit}

Query String Parameters

Parameter Type Description
page string Optional. Page number
limit string Optional. Items per page

CREATE TAG

  POST /api/v1/tags

JSON Body Parameters

Parameter Type Description
tag string Required. Tag name
posts integer[] Optional. Array of integer with Post Entity ID

UPDATE TAG

  PATCH /api/v1/tags

JSON Body Parameters

Parameter Type Description
tag string Optional. Tag name
posts integer[] Optional. Array of integer with Post Entity ID

DELETE TAG

  DELETE /api/v1/tags/${tagId}

URL Parameter

Parameter Type Description
tagId integer Required. Tag ID

Post Entity

GET ALL POSTS

  GET /api/v1/posts?page=${page}&limit=${limit}

Query String Parameters

Parameter Type Description
page string Optional. Page number
limit string Optional. Items per page

CREATE POST

  POST /api/v1/posts

JSON Body Parameters

Parameter Type Description
title string Required. Post title
content string Required. Post HTML Content
image url Required. Image url
tags integer[] Optional. Array of integer with Tag Entity ID

UPDATE POST

  PATCH /api/v1/posts

JSON Body Parameters

Parameter Type Description
title string Optional. Post title
content string Optional. Post HTML Content
image url Optional. Image url
tags integer[] Optional. Array of integer with Tag Entity ID

DELETE POST

  DELETE /api/v1/posts/${postId}

URL Parameter

Parameter Type Description
postId integer Required. Post ID