Dummy API created for testing purposes. It defines all possible scenarios/combinations of resources/endpoints and segments.
curl -v -X GET "[ENVIRONMENT-DOMAIN]/api-platform-test/" -H 'Accept: application/vnd.hmrc.2.0+json' -H "Cache-Control: no-cache"
{"uri":"/","method":"GET","resourceDetails":"Ciao Empty!"}
curl -v -X GET "[ENVIRONMENT-DOMAIN]/api-platform-test/ciao?surname=Djokovic&firstName=Novak" -H 'Accept: application/vnd.hmrc.2.0+json' -H "Cache-Control: no-cache"
{"uri":"/ciao?surname=Djokovic&firstName=Novak","method":"GET","resourceDetails":"Ciao: Some(Djokovic), Some(Novak), None"}
curl -v -X GET "[ENVIRONMENT-DOMAIN]/api-platform-test/ciao/Tesla" -H 'Accept: application/vnd.hmrc.2.0+json' -H "Cache-Control: no-cache"
{"uri":"/ciao/Tesla","method":"GET","resourceDetails":"Ciao Surname: Tesla"}
curl -v -X GET "[ENVIRONMENT-DOMAIN]/api-platform-test/ciao/Rossi/Valentino?middleName=Alvise"" -H 'Accept: application/vnd.hmrc.2.0+json' -H "Cache-Control: no-cache"
{"uri":"/ciao/Rossi/Valentino?middleName=Alvise","method":"GET","resourceDetails":"Ciao Full Name: Rossi, Valentino, Some(Alvise)"}
curl -v -X GET "[ENVIRONMENT-DOMAIN]/api-platform-test/ciao/kennedy/john/fitzgerald" -H 'Accept: application/vnd.hmrc.2.0+json' -H "Cache-Control: no-cache"
{ "code" : "MATCHING_RESOURCE_NOT_FOUND", "message" : "A resource with the name in the request can not be found in the API" }
curl -v -X GET|PUT "[ENVIRONMENT-DOMAIN]/api-platform-test/details/Venice/address" -H 'Accept: application/vnd.hmrc.3.0+json' -H "Cache-Control: no-cache"
{"uri":"/city-details/Venice/address","method":"GET|PUT","resourceDetails":"City: Venice, Address: Oxford Street"}
curl -v -X GET|DELETE|POST "[ENVIRONMENT-DOMAIN]/api-platform-test/details/Venice/30016" -H 'Accept: application/vnd.hmrc.3.0+json' -H "Cache-Control: no-cache"
{"uri":"/city-details/Venice/30016","method":"GET|DELETE|POST","resourceDetails":"City: Venice, Postcode: 30016"}
sbt run-all-tests
This code is open source software licensed under the Apache 2.0 License