richhollis / swagger-docs

Generates swagger-ui json files for Rails APIs with a simple DSL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generate docs for multiple versions of an API

ninjonxb opened this issue · comments

I am running into issues getting multiple versions of the api docs generated.

Relevant Files:

Swagger::Docs::Config.register_apis({
  '1.0' => {
    :api_extension_type => nil,
    controller_base_path: 'api/v1',
    api_file_path: 'public/apidocs/api/v1',
    base_path: 'http://localhost:3000/',
    clean_directory: true,
    :attributes => {
      :info => {
      }
    }
  },
  '2.0' => {
    :api_extension_type => nil,
    controller_base_path: 'api/v2',
    api_file_path: 'public/apidocs/api/v2',
    base_path: 'http://localhost:3000/',
    clean_directory: true,
    :attributes => {
      :info => {
      }
    }
  }
})

My file directory is setup:

controllers
--api
----v1
------various controllers with swagger info in them
----v2
------various controllers with swagger info in them

When I generate swagger docs I get

1.0: 1 processed / 1 skipped
2.0: 0 processed / 0 skipped

After running that in the apidocs/api folder I have both the v1 and the v2 folder. v1 has all of the information but v2 only has the api-docs.json
I am not sure why it is not seeing the v2 api's

Duplicate of #92