mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-15 12:08:17 -06:00
Make generate_swagger
command work
This allows us to statically generate OpenAPI specification documents.
This commit is contained in:
parent
dd35faf422
commit
e7c84cb32b
@ -328,6 +328,7 @@ SWAGGER_SETTINGS = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'VALIDATOR_URL': None,
|
'VALIDATOR_URL': None,
|
||||||
|
'DEFAULT_INFO': 'netbox.urls.swagger_info',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,16 +8,18 @@ from netbox.views import APIRootView, HomeView, SearchView
|
|||||||
from users.views import LoginView, LogoutView
|
from users.views import LoginView, LogoutView
|
||||||
from .admin import admin_site
|
from .admin import admin_site
|
||||||
|
|
||||||
|
swagger_info = openapi.Info(
|
||||||
|
title="NetBox API",
|
||||||
|
default_version='v2',
|
||||||
|
description="API to access NetBox",
|
||||||
|
terms_of_service="https://github.com/digitalocean/netbox",
|
||||||
|
contact=openapi.Contact(email="netbox@digitalocean.com"),
|
||||||
|
license=openapi.License(name="Apache v2 License"),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
schema_view = get_schema_view(
|
schema_view = get_schema_view(
|
||||||
openapi.Info(
|
swagger_info,
|
||||||
title="NetBox API",
|
|
||||||
default_version='v2',
|
|
||||||
description="API to access NetBox",
|
|
||||||
terms_of_service="https://github.com/digitalocean/netbox",
|
|
||||||
contact=openapi.Contact(email="netbox@digitalocean.com"),
|
|
||||||
license=openapi.License(name="Apache v2 License"),
|
|
||||||
),
|
|
||||||
validators=['flex', 'ssv'],
|
|
||||||
validators=[],
|
validators=[],
|
||||||
public=True,
|
public=True,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user