-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to reference the properties defined in form-data in overwriteRequestBody #662
Comments
hi @Arrow2dknee The jsonblob mentions $ref elements, but the actual $ref values are missing. |
Hi @thim81, AddVehicleDto (from $ref) looks like below The form-data needs the below required information- I have written my overwrites for this endpoint as below: Let me know if this helps. |
Hi @thim81 , Could you please have a look into my comment above? |
Hi @thim81 , I'm still having this issue. |
hi @Arrow2dknee Would it be possible to share the OpenAPI endpoint as YAML or JSON, only that endpoint? |
hi @Arrow2dknee We still want to help figure out what is going wrong, would you be able the OpenAPI endpoint as YAML or JSON, only that endpoint? |
Hello there.
I have a POST endpoint called /vehicles which has been implemented as multipart/form-data and accepts 3 properties, namely-
In postman, this request would look like below screenshot-
and, the OpenAPI spec is as follows-
{ "/v1/vehicles": { "post": { "operationId": "VehicleController_addVehicle", "parameters": [], "requestBody": { "required": true, "description": "Vehicle data", "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/AddVehicleDto" } } } }, "responses": { "200": { "description": "Vehicles added successfully" }, "401": { "description": "Authorization is required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnauthorizedExceptionDto" } } } }, "404": { "description": "Vehicle type does not exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFoundExceptionDto" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnknownExceptionDto" } } } } }, "tags": [ "Vehicles" ], "security": [ { "bearer": [] } ] } } }
Alternatively, please find the above spec in jsonblob
My overwrites.yml code looks like below:
- openApiOperation: "POST::/v1/vehicles" overwriteRequestBody: - key: 'files' value: 'files:tests/portman/create-vehicle.json' - key: 'vehicleType' value: '6703abea1c0324d0e17d5afb' - key: 'release' value: '6703abf51c0324d0e17d5b28' overwriteRequestHeaders: - key: Content-Type remove: true
In the overwrites.yml file, I'm referencing the form-data props as key: 'files', key: 'vehicleType' etc
But, I don't think this works as expected.
When running the tests locally, got the following error from API-
Could you please guide me what I'm doing incorrectly.
The text was updated successfully, but these errors were encountered: