title: Change swagger 2.0 docs path url
body: <p>This is how I configure swagger : </p>
  
  <pre><code> const openapi = Openapi.initialize({
      paths: openApiPaths,
      app,
      apiDoc,
    });
    const openApiSpec = openapi.apiDoc;
  
    console.log(openApiSpec);
  
    app.use(swaggerUI(openApiSpec));
  </code></pre>
  
  <p>How can I change the base path <code>/docs/</code> to <code>/projectName/docs/</code> ?</p>
  
  <p>I did not find any relevant answer to that</p>
  
  <blockquote>
    <p>EDIT</p>
  </blockquote>
  
  <p>My api doc is described as below in it's own file: </p>
  
  <pre><code>export const apiDoc = {
    'x-express-openapi-additional-middleware': [checkBodyValidity],
    swagger: '2.0',
    basePath: '/api/v1',
    info: {
      title: 'Documentation Rest API',
      version: 'v1',
    },
    paths: {},
    definitions: {}
  }
  </code></pre>
  
  <p>CheckBodyValidity is kind of a middleware that check request params validity (not relevant for my question): </p>
  
  <pre><code>export const checkBodyValidity: any = (req, res, next) =&gt; {}
  </code></pre>
  
  <p>Swagger is initialized as below in a file named openapiSetup : </p>
  
  <pre><code>export async function init(app: any): Promise&lt;any&gt; {
  
  [...]
  
    const openapi = Openapi.initialize({
      paths: openApiPaths,
      app,
      apiDoc,
    });
    const openApiSpec = openapi.apiDoc;
  
    app.use(swaggerUI(openApiSpec));
  
  }
  </code></pre>
  
  <p>-> openApiPaths is the path{} part if the doc. It's constructed from directories and file names</p>
  
  <p>Finally in express app : </p>
  
  <pre><code>await openapiSetup.init(app);
  </code></pre>