Skip to content
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

How to create an array while using discriminator #1571

Open
mkirolos-safco opened this issue Apr 11, 2024 · 0 comments
Open

How to create an array while using discriminator #1571

mkirolos-safco opened this issue Apr 11, 2024 · 0 comments
Labels

Comments

@mkirolos-safco
Copy link

I am currently developing an api that will have a different response depending on the request being sent, both of the responses should return arrays, using discriminator I was able to show the different responses but not as arrays, not sure what I am missing

Thanks in advance

* @OA\Response(
*     response="200",
*     description="Response with different Request Type for the shipment",
*     @OA\JsonContent(
*         discriminator="requestType",
*         @OA\Examples(
*             example="forRateResponse",
*             summary="Rate Response",
*             value={
*                  "final_charge": 26.69,
*                  "currency": "USD",
*                  "weight": 5.5,
*                  "weight_unit": "LBS"
*                }
*         ),
*         @OA\Examples(
*             example="forShopResponse",
*             summary="Shop Response",
*             value={
*                  "service_code": "01",
*                  "service_description": "Next Day Air",
*                  "final_charge": 172.23,
*                  "currency": "USD",
*                  "weight": 5.5,
*                  "weight_unit": "LBS"
*              }
*         )
*     )
* ),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants