-
My use case is the following: I have Items that have Properties. There is a Many 2 Many relationship between them. I want to be able to create Items with Properties that are created on the fly. I mean if property exists it is fetched, if it does not it is created. I can do so using the following pattern:
With this setup, when I perform a POST request with the following payload on the API directly (using Swagger):
I get a 201 with the following body:
Which is the expected result (property are created on the fly). Now if I want to automatize this check using Unit Test, I'll do something like this:
And then I get a 201 where properties are totally ignored (seems like they are popped):
I wonder if I am doing something wrong in automatizing test or if it is potentially a bug. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
May I ask why not being able to reproduce the API behaviour in Unit Test is just a discussion and not an issue ? |
Beta Was this translation helpful? Give feedback.
It seems with the
format
switch it works:But with
Content-Type
defined we need to encode the JSON: