2

I have a header param which should be used for every route. But I don't want to add the annotation for this param in every Controller. I tried different things but it's not possible to add it to an interface or to a class which will be exteneded by every controller. Is there a possibility to make it global? This is the param I want to set:

/**
 * @OA\Parameter(
 *     name="x-locale",
 *     in="header",
 *     description="Locale for siteaccess matching",
 *     )
 */
1
  • Did you find something helpful to achieve that ? Commented Feb 5, 2024 at 14:18

1 Answer 1

0

Based on the How to define global parameters in OpenAPI? it is pretty creepy. Something like this:

nelmio_api_doc:
    documentation:
        components:
            securitySchemes:
                # ...
                Locale:
                    type: apiKey
                    in: header
                    name: Accept-language
                    description: "Examples:<br>en<br>en-US"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.