zircote/swagger-php

Complex object not showing inner classes in shema

Closed this issue · 0 comments

I'm consuming an external wsdl using wsdltophp. This is generating me a large class structure which I would like to make consumable by my API via SwaggerUI.

This is how I'm annotating my API entry point:

     /**
     * @OA\Post(
     *     path="/vf/alta/{registroFacturacionType}/{datosControlType}",
     *     operationId="vfAlta",
     *     description="",
     *     tags={"vf"},
     *     security={{"bearerAuth":{}}},
     *     @OA\Parameter(
     *          name="registroFacturacionType",
     *          in="path",
     *          required=true,
     *          description="",
     *          @OA\Schema(ref="#/components/schemas/RegistroFacturacionType")
     *     ),
     *     @OA\Parameter(
     *          name="datosControlType",
     *          in="path",
     *          required=true,
     *          description="",
     *          @OA\Schema(ref="#/components/schemas/DatosControlType")
     *     ),
     *     @OA\Response(
     *         response=200,
     *         description="",
     *         @OA\Schema(ref="RespuestaAltaFactuSistemaFacturacionType")
     *     )
     * )
     */

The generated swagger entry point looks like this now:
enter image description here

Where all the inner classes of my main class are represented by strings. If we just take a look at the first Property (IDFactura), this is the code generated by wsdltophp

     /**
     * The IDFactura
     * @var \App\Application\ServiceReferences\Verifactu\StructType\IDFacturaExpedidaType|null
     * @OA\Property()
     */
    protected ?\App\Application\ServiceReferences\Verifactu\StructType\IDFacturaExpedidaType $IDFactura = null;

(The @OA\Schema is also generated by wsdltophp) But it's clear that my SwaggerUI is representing this inner class like a simple string.

Since this WSDL is external and I have no control over it, nor the wsdltophp generated code, I'm looking for a solution which would avoid updating/modifying those external classes