Open propheel opened 3 years ago
@propheel Thanks for raising this issue. In order to answer your question, I need some more details regarding this issue. I have sent you an offline chat about this issue. We will have a meeting about it soon and then I will work on this issue. Thanks
@propheel Please find the example here for the scenario that we discussed: https://github.com/Azure/autorest.testserver/blob/main/swagger/body-complex.json#L972
@sarangan12 Thanks for the example. Looks exactly as the problematic one. Still my case doesn't work. I used 6.0.0-beta.5 and core v2.
The input JSON is:
{
"geometries": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"geometryId": "ExampleId"
},
"geometry": {
"type": "Point",
"coordinates": [
-111.9267386,
33.5362475
]
}
}
]
},
"distances": [
176.3
]
}
The JSON in the body of the POST request is:
{"geometries":{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point"},"properties":{"geometryId":"ExampleId"}}]},"distances":[176.3]}
So it's missing coordinates
property of the geometry
.
The JSON is a GeoJSON object of type FeatureCollection. One of the features has a single GeoJSON object of type Point as a geometry. The Swagger definitions of those classes are available in the original PR.
Can you point to the place where the CI passes the test mentioned by you?
Hi, I'm using
6.0.0-alpha.20210514.1
version to generate code for this PRThe problem is whenever POST operation accepts JSON object in body that has its schema defined as a base class then when I pass some object of class that inherits the base class all its own properties are gone in the request - only base class properties are present.
Example: if you were to send a Fruit type object { "name": "Generic fruit" } and you put an Apple type object { "name": "Apple", "color": "red" } as a parameter then you would see only { "name": "Apple" } in the POST request body.
The problem was found in the PR first with PostRouteDirectionsRequestBody in specification/maps/data-plane/Route/preview/1.0/route.json file, but is present also in other POST operations having a base class as a body schema.
Please advise if this is expected and if not then what can we do to mitigate.