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 add common headers using spring fox 3 #4071

Open
XSun771 opened this issue Sep 15, 2023 · 0 comments
Open

How to add common headers using spring fox 3 #4071

XSun771 opened this issue Sep 15, 2023 · 0 comments

Comments

@XSun771
Copy link

XSun771 commented Sep 15, 2023

Please take the time to search the repository, if your question has already been asked or answered.

version:

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-boot-starter</artifactId>
        <version>3.0.0</version>
    </dependency>

What kind of issue is this?

  • [yes] Question. Is this a question about how to do a certain thing?

  • [yes if there is no solution to the question] Feature Request

My question:

I am using spring fox 3 to generate the swagger document.

Currently there are 20 APIs in this swagger document, 18 of them have some common headers as below:


                    {
                        "name": "uuid",
                        "in": "header",
                        "description": "128 bit random universally unique identifier (UUID)",
                        "type": "string",
                        "required": true
                    },
                    {
                        "name": "channelId",
                        "in": "header",
                        "description": "Registered channel ID",
                        "type": "string",
                        "required": true
                    },
                    {
                        "name": "businessCode",
                        "in": "header",
                        "description": "Business code",
                        "type": "string",
                        "required": true
                    },

But 2 of them don't need the headers.

Appreciate a lot if you can advise a solution using spring fox 3 to realize that the 18 APIs have the common headers but the 2 APIs don't have.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant