marcgibbons / django-rest-swagger

Swagger Documentation Generator for Django REST Framework: deprecated
https://marcgibbons.com/django-rest-swagger/
BSD 2-Clause "Simplified" License
2.59k stars 599 forks source link

It should be possible to specify version for Swagger spec #613

Open tsudmi opened 7 years ago

tsudmi commented 7 years ago

Request to the <documentation url>/?format=openapi returns a JSON object of Swagger spec. For example, {"swagger": "2.0", "info": {"title": "My great API", "version": ""}, "paths": {}}.

Please make it possible to specify version of the project as well.

tsudmi commented 7 years ago

To be more precise following line should be configurable: https://github.com/core-api/python-openapi-codec/blob/master/openapi_codec/encode.py#L18

cvega commented 7 years ago

There are quite a few options I'm uncertain of setting. Some of these options include:

description
...
version
...
termsOfService
...
contact:
  email
...
license:
  name
  url
...
basePath:
...
tags:
- name: 
  description: 
  externalDocs:
    description: 
    url:
...
schemes:
...
externalDocs:
  description
  url
marcgibbons commented 7 years ago

PRs are certainly welcome for this and some of the additional meta attributes specific to the Open API :) For the version, were you looking for a static setting which can be set in the SWAGGER_SETTINGS? Or one that is derived from the DRF versioning scheme?s

tsudmi commented 7 years ago

I was looking for a static setting in the SWAGGER_SETTINGS.