Skip to content

Example implementation of the swagger petstore with TheNoFramework

License

Notifications You must be signed in to change notification settings

iyaki/TheNoFramework-petstore-example

Repository files navigation

TheNoFramework-petstore-example

Example implementation of a simplified petstore rest api with TheNoFramework.

Deploy

git clone git@github.com:iyaki/TheNoFramework-petstore-example.git && cd TheNoFramework-petstore-example
composer install
chmod 776 storage
docker-compose up -d

TheNoFramework doesn't implements a router system so all the routing of this app is done by nginx.

Available endpoints

Note: By default the app listens the port 8080. All the endpoints implements a Bearer token authentication with the token: iamatoken

GET /pet/

example curl:

curl --request GET \
  --url http://localhost:8080/pet/1590270079 \
  --header 'authorization: Bearer iamatoken'

POST /pet/

example curl:

curl --request POST \
  --url http://localhost:8080/pet \
  --header 'authorization: Bearer iamatoken' \
  --header 'content-type: application/json' \
  --data '{
	"name": "Firulais"
}'

PUT /pet/

example curl:

curl --request PUT \
  --url http://localhost:8080/pet \
  --header 'authorization: Bearer iamatoken' \
  --header 'content-type: application/json' \
  --data '{
	"id": 1590270079,
	"name": "Mr Whiskers"
}'

DELETE /pet/

example curl:

curl --request DELETE \
  --url http://localhost:8080/pet/1590251389 \
  --header 'authorization: Bearer iamatoken'

GET /pet/findByStatus

example curl:

curl --request GET \
  --url 'http://localhost:8080/pet/findByStatus?status=sold' \
  --header 'authorization: Bearer iamatoken'

GET /store/order/

example curl:

curl --request GET \
  --url http://localhost:8080/store/order/1592275553 \
  --header 'authorization: Bearer iamatoken'

POST /store/order

example curl:

curl --request POST \
  --url http://localhost:8080/store/order \
  --header 'authorization: Bearer iamatoken' \
  --header 'content-type: application/json' \
  --data '{
	"petId": 1590270079,
	"shipDate": "2020-06-20T10:00:00"
}'

DELETE /store/order/

example curl:

curl --request DELETE \
  --url http://localhost:8080/store/order/1590270111 \
  --header 'authorization: Bearer iamatoken' \
  --header 'content-type: application/json'

About

Example implementation of the swagger petstore with TheNoFramework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages