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 generate an empty array instead of an empty object? #591

Closed
jinseokoh opened this Issue Oct 5, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@jinseokoh

jinseokoh commented Oct 5, 2018

With the following annotations,

     * @OA\SecurityScheme(
     *     type="apiKey",
     *     in="header",
     *     securityScheme="api_key",
     *     name="api_key"
     * )
     * @OA\Post(
     *     path="/api/v1/create",
     *     security={
     *       {"api_key":{}}
     *     },
     *     @OA\Response(
     *         response="default",
     *         description="successful operation"
     *     )
     * )

it generates

      security:
        -
          api_key: {  }

while the expected output based on OpenApi v3 documentation is as follows:

    security:
      - api_key: [] 

How can I produce an empty array instead of empty object? This Doctrine annotation's pretty confusing.

@bfanger

This comment has been minimized.

Collaborator

bfanger commented Oct 12, 2018

The bug was in the yaml conversion, that one converted the empty array to an empty object.

I've added the Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment