Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Spiral's avatar

Anybody have specialization in swagger for api docs i have a question

Hi!

I want to make api document for multiple client with the help of swagger UI

i have api's and want some api can access for public and some will private client and they will access only their api's endpoint and will use

Can you give me the best suggestion or example so that could solve my problem with the help of you

Thanks in advance

0 likes
6 replies
fylzero's avatar

@spiral You can specify that they need an API Key in Swagger. I usually use Stoplight Studio to edit my Swagger docs.

Something to this effect...

    options:
      security:
        - API Key: []
25 likes
Spiral's avatar

Thanks @fylzero brother you replyed me...

Can you give me the example

Bro i have multiple end points in the project mean client, vendor, candidate have different end points

i want to make different docs for client so that i will provide to an other only client end point docs

same as vendor and candidate

these are endpoints are in the same project but i want to make different docs of these apis so that candidate will only see their docs and use

same as vendor will see only their swagger docs and use

same as candidate will see anly candidate swagger docs and use

Plz can you help me in deep so that i will make these work

Thanks in advance @fylzero

http://example.com/swagger/ClientOperations.json
http://example.com/swagger/CandidateOperations.json
http://example.com/swagger/PublicOperations.json
fylzero's avatar

@spiral I'm not sure I understand what you are looking to have answered.

Simply specifying an API key is required should be enough to let the user know they must be authenticated before they can use the endpoints.

Creating different Swagger docs is perfectly acceptable. You could do a single doc and prefix things by section and ability or just use separate docs as you are doing. Neither is a problem or best practice imo.

25 likes
Spiral's avatar

Copy you awnser which i want Creating different Swagger docs is perfectly acceptable. You could do a single doc and prefix things by section and ability or just use separate docs as you are doing. Neither is a problem or best practice imo.

Yes bro i want Multiple Swagger Api Documents for a one project because in this project has integrated with different client and services

so i want to provide different api docs for different services client so that they will only see their docs

Spiral's avatar

Trying the best process so that you understand the my question

  1. I have a project in laravel apis

  2. These laravel Apis are for different services/client e.g integrated some services/company in this project

  3. I have all Apis in one swagger.json file

  4. Some Apis which no need for some services/Companies which are integrated so that i want to provide only their need Apis

  5. As well as i want to provide only these Apis docs in swagger which they want not other services Apis

bro I will my best try that you wil understand

Spiral's avatar

Creating different Swagger docs is perfectly acceptable. You could do a single doc and prefix things by section and ability or just use separate docs as you are doing. Neither is a problem or best practice imo.

Can you provide me plateform or code so that i will solve my problem with the help of you as you are saying same i want

Please or to participate in this conversation.