In Swagger Documentation, how to receive data from a different host location by providing custom properties in body section of request?
I am documenting my RESTFul API project with swagger. Apart from the main URL, I have another service URL to get the access token(and other properties). I have three ways to get it and use it in headers for other API calls in the same documentation.
- First is to create another project with a different host which isn't user-friendly for non-coders.
- Second is to take the base URL as empty and append localhost:3000 for every HTTP API call, which is doable but not effective.
- Third would be to use OAuth in swagger-documentation. I have trouble understanding and implementing it.
Exploring the third option, I would like to know if we can set custom key-value pairs (in JSON format) in the body section of the POST request to get the access token from a Different Base URL? How to set this body type as form-data? This should be in the same swagger generated Document.