Skip to content

luisrovirosa/corporate_kata_frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

Frontend for the Corporate Hotel Booking

Server API

How to call the remote Server API

Example against Swagger stub server

curl --location --request POST 'https://virtserver.swaggerhub.com/islomar/CorporateHotelBooking/1.0.0/booking' \
-H "accept: application/json" -H "Content-Type: application/json" \
-d '{
   "employeeId": "John Smith",
   "hotelId": "FOUR_SEASONS_HAWAI_BEACH",
   "roomType": "JUNIOR_SUITE"
}' -vvv

Example against Postman stub server

curl --location --request POST 'https://00f83f5c-c689-41d8-a487-5c403fb1235e.mock.pstmn.io/booking' \
-H "accept: application/json" -H "Content-Type: application/json" \
-d '{
  "employeeId": "John Smith",
  "hotelId": "FOUR_SEASONS_HAWAI_BEACH",
  "roomType": "JUNIOR_SUITE"
}' -vvv

Example using a local Server API

Remote file

  1. First, run the Docker container: docker-compose -f openapi/docker-compose.yml up

  2. Then, send a POST request:

curl -X POST 'http://127.0.0.1:8080/islomar/CorporateHotelBooking/1.0.0/booking' \
-H "accept: application/json" -H "Content-Type: application/json" \
-d '{
    "employeeId": "John Smith",
    "hotelId": "FOUR_SEASONS_HAWAI_BEACH",
    "roomType": "JUNIOR_SUITE"
}' -vvv | jq

Local file

  1. First, run the Docker container: docker run -p 8080:8080 -v $PWD/openapi/corporate-hotel-api.yaml:/openapi/corporate-hotel-api.yaml -e "SWAGGER_MOCK_SPECIFICATION_URL=/openapi/corporate-hotel-api.yaml" --rm swaggermock/swagger-mock

  2. Then, send a POST request:

curl -X POST 'http://127.0.0.1:8080/v1/booking' \
-H "accept: application/json" -H "Content-Type: application/json" \
-d '{
    "employeeId": "John Smith",
    "hotelId": "FOUR_SEASONS_HAWAI_BEACH",
    "roomType": "JUNIOR_SUITE"
}' -vvv | jq
  1. The endpoint http://127.0.0.1:8080/islomar/CorporateHotelBooking/1.0.0/booking would work as well.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published