Is it possible to change data source in swagger?

Options

Hi, my question is that if it's possible to change data-source for auto-generated swagger page. Currently, you can't change headers, therefore swagger always use live data.

Best Answer

  • jakespirek
    jakespirek Member, Administrator

    ADMIN

    edited August 2023 Answer ✓
    Options

    Hi there! Are you referring to testing your APIs via the Swagger docs and using your test data source?

    I don't believe you can add headers from there, so I'd recommend using something like Postman because you can add the X-Data-Source: test header to your request (swap your data source name if it's not test).

    The cool thing is that you can import your Swagger docs right into Postman, so you can easily add all your endpoints with the click of a button.