question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

POST Owner doesn't create Pet nor Visits

See original GitHub issue

I’m trying to POST a new “owner” with “pet” and “visit”: http://localhost:9966/petclinic/swagger-ui.html#!/owner-rest-controller/addOwnerUsingPOST

This is the JSON Body I am sending:

{
  "address": "Fakestreet",
  "city": "Langdorp",
  "firstName": "Kristof",
  "id": 0,
  "lastName": "fakelastname",
  "pets": [
    {
      "birthDate": "2000-08-13T06:32:56.478Z",
      "id": 0,
      "name": "Darko",
      "owner": {},
      "type": {
        "id": 2,
        "name": "dog"
      },
      "visits": [
        {
          "date": "2019/03/15",
          "description": "Sick",
          "id": 0,
          "pet": {}
        }
      ]
    }
  ],
  "telephone": "016565758"
}

I’m expecting the response so the Owner has been created, pet and visit also. (just like described on the swagger) Only the response I receive is:

{
    "id": 16,
    "firstName": "Kristof",
    "lastName": "fakelastname",
    "address": "Fakestreet",
    "city": "Langdorp",
    "telephone": "016565758",
    "pets": []
}

I checked and it doesn’t create the pet nor visit in the backend.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vfedorivcommented, Mar 15, 2019

Hi @KristofVanKriekingen1337 Well, this endpoint shouldn’t save child objects( pet etc…). If you want to improve it, need changes in JacksonCustomOwnerDeserializer and OwnerRestController.

0reactions
vfedorivcommented, Sep 17, 2021

@arey yes, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Information for renters with pets
Review your lease. Typically if a lease does not mention pets at all, then you are allowed to have pets. Some communities and...
Read more >
Visits from former owners: Good for Dogs? - The Other End of ...
Although I'm only speculating, I suspect it depends on how settled and stable the dog is in his or her new home. Here...
Read more >
Pets and Service Animals - Tenant Resource Center
This is a special situation where the landlord's pet policy does not apply. A service animal or emotional support animal should not be...
Read more >
Guilty or Innocent? Do pets know they have done something ...
Do they understand they've done something wrong when their owners get ... Here lies the evidence that your dog or cat is guilty...
Read more >
FAQs on Service and Assistance Animals in Housing
Importantly, assistance animals are not considered pets and housing providers may not ... It does not have the force of law and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found