Clarifications for Swagger documentation for Java Spring Boot MongoDB Starter project
Blog reference: https://www.mongodb.com/blog/post/rest-apis-with-java-spring-boot-and-mongodb Clarifications requested for following API calls: PUT /api/person - Not updating user; adding Path Parameter {id} throws 405 "Method Not Allowed" error POST/PUT/DELETE calls /api/persons - Spec not clear GET/DELETE calls /api/persons/{ids} - format of Path Parameter {ids} not clear Thanks.
I was able to successfully issue the call PUT /api/person. Please ignore this item in the list of clarifications provided.
curl command for POST /api/persons call provided below (returns 500 error):
curl --location --request POST 'http://localhost:8080/api/persons'
--header 'Content-Type: application/json'
--header 'Cookie: connect.sid=s%3AMYWmNGShgy9FoqkfK4_xo0fJqL6cgFJV.pOpjNjc%2FdvfyDgYSjAKRpUTouDZZ8IebIs3jhUuv54A'
--data-raw '[
{
"address": {
"city": "City1",
"country": "USA",
"number": 123,
"postcode": "99999",
"street": "1234 ABC Drive"
},
"age": 29,
"cars": [
{
"brand": "Honda",
"maxSpeedKmH": 100,
"model": "Accord"
}
],
"createdAt": "2022-09-04T06:10:31.410Z",
"firstName": "Test1",
"id": {
"timestamp": 0
},
"insurance": true,
"lastName": "Tester"
},
{
"address": {
"city": "City1",
"country": "USA",
"number": 123,
"postcode": "99999",
"street": "1234 ABC Drive"
},
"age": 29,
"cars": [
{
"brand": "Honda",
"maxSpeedKmH": 100,
"model": "Accord"
}
],
"createdAt": "2022-09-04T06:10:31.410Z",
"firstName": "Test2",
"id": {
"timestamp": 0
},
"insurance": true,
"lastName": "Tester"
}
]'