Forum Discussion
5 Replies
- Humashankar
Champion Level 3
To improve performance, consider optimizing your testing strategy. You can start by staggering test execution times to avoid overlaps, which can put a heavy load on your system.
Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards OpenAPI only allows one POST/GET/etc. operation per path, but you can define multiple possible request bodies by using oneOf:
paths: /something: post: operationId: createSomething requestBody: required: true content: application/json: schema: oneOf: - $ref: '#/components/schemas/Body1' - $ref: '#/components/schemas/Body2'
- NixolOccasional Contributor
Thanks HKosova for your explanation.
Could you also assist to answer the following followup questions:
1. can each of the requests have a different tag? eg. Body1 has "TagA" and body2 has "TagB"
2. can each of the requests have a corresponding response? e.g. if Body1 is used, then the response will be Response1, if Body2 is used then the response will be Response2.1. No.
2. No. You can use oneOf to define the possible response schemas, but OpenAPI doesn't support request/response correlation.
Here's a related feature request you can track: