Flask-restplus: any way to sort the namespaces in swagger? Flask-restplus: any way to sort the namespaces in swagger? flask flask

Flask-restplus: any way to sort the namespaces in swagger?


I am probably way too late but I have been wondering the same thing but with flask_restx so posting this to hopefully help others. But it seems to go by the order in which your namespaces are imported.

For example:

from rest.endpoints.Episodes import ns as episodes_namespacefrom rest.endpoints.Plex import ns as plex_namespacefrom rest.endpoints.Server import ns as server_namespace

Will be ordered in swagger as:

  1. Episodes
  2. Plex
  3. Server

While:

from rest.endpoints.Server import ns as server_namespacefrom rest.endpoints.Episodes import ns as episodes_namespacefrom rest.endpoints.Plex import ns as plex_namespace

Will be ordered in swagger as:

  1. Server
  2. Episodes
  3. Plex