Closed mehrzut closed 1 year ago
Hi @mehrzut , could you please provide swagger file example. expected and actual results for comparation?
Hi actually I found out that the swagger itself is showing the body like this:
"patchDocument": {
"contractResolver": {}
}
but the backend developer says they used the .Net class as the input like this:
public JsonPatchDocument<Model> PatchDocument { get; set; }
Is there a problem with the backend?
That's would be great to take a look to full swagger file. you can rename everything and change urls if it's secret. Or share it to my email vovanella95@mail.ru
Because for now I don't know what is patchDocument and contractResolver :D
I want to check it in swagger editor and understand, what should be generated
That's would be great to take a look to full swagger file. you can rename everything and change urls if it's secret. Or share it to my email vovanella95@mail.ru
Because for now I don't know what is patchDocument and contractResolver :D
I want to check it in swagger editor and understand, what should be generated
I sent it to you.
@mehrzut yes, thanks, seen your message. Working on it
Hi @mehrzut , I've checked your swagger file. You can also check it in Swagger Editor. Looks like patchDocument indeed the field of UpdateDriverCommand
class. Example of request body looks like
{
"driverId": 0,
"patchDocument": {
"contractResolver": {}
}
}
For actual swagger file, according scheme, DriverJsonPatchDocument
is a class with two properties: operations
(List of DriverOperation) and contracResolver
- IContractResolver
class.
"DriverJsonPatchDocument": {
"type": "object",
"properties": {
"operations": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DriverOperation"
},
"nullable": true,
"readOnly": true
},
"contractResolver": {
"$ref": "#/components/schemas/IContractResolver"
}
},
"additionalProperties": false
},
So, if this patchDocument
is not needed - then it's swagger file issue. You can always check swagger file in Swagger Editor portal to check all schemas, requests and examples.
I'm closing the issue. But if you have any questions - feel free to reopen it.
When using the API call function of a PATCH request, the generated JSON structure includes an extra "patchDocument" object wrapping the operations. It should instead directly contain the "operations" array.
Expected JSON Structure:
Actual JSON Structure: