Python
The following section covers the components of different Python frameworks and their library components that NightVision’s API Discovery capability can detect and use to generate OpenAPI documentation. If a component that you use is not supported, please get in touch with our support team at support@nightvision.net, and we can add this as a new feature.
Django
Section titled “Django”| Library Component | Description |
|---|---|
| django.http.QueryDict | In Django, GET or POST parameters can be accessed using the `QueryDict` class, which is a dictionary-like object containing the query parameters. |
| django.HttpRequest | Represents an HTTP request, including methods and data sent by the client. |
| django.urls.resolvers.RoutePattern | Represents a route pattern used for URL routing. |
| django.conf.settings | Represents Django’s settings configuration. |
| django.conf.urls.url() | Function to define a URL pattern in Django. |
| django.conf.urls.include() | Function to include other URL patterns from a different module or app. |
| django.urls.path() | Function to define URL patterns with routing based on paths. |
| django.urls.include() | Function to include other URL configurations in your Django project. |
| django.urls.re_path() | Function to define complex URL patterns using regular expressions. |
| django.views.generic.View | A base class for all class-based views in Django. |
DRF (Django REST framework)
Section titled “DRF (Django REST framework)”| Library Component | Description |
|---|---|
| rest_framework.generics.GenericAPIView | A base class for all generic views in DRF, providing common functionality. |
| rest_framework.generics.CreateAPIView | Provides a view that handles HTTP POST requests to create a new object. |
| rest_framework.generics.DestroyAPIView | Provides a view that handles HTTP DELETE requests to delete an object. |
| rest_framework.generics.ListAPIView | Provides a view that handles HTTP GET requests to list objects. |
| rest_framework.generics.ListCreateAPIView | Provides a view that handles both HTTP GET (list) and POST (create) requests. |
| rest_framework.generics.RetrieveAPIView | Provides a view that handles HTTP GET requests to retrieve a single object. |
| rest_framework.generics.RetrieveDestroyAPIView | Provides a view that handles HTTP GET (retrieve) and DELETE (destroy) requests. |
| rest_framework.generics.RetrieveUpdateAPIView | Provides a view that handles HTTP GET (retrieve), PUT (update), and PATCH (partial update) requests. |
| rest_framework.generics.RetrieveUpdateDestroyAPIView | Provides a view that handles HTTP GET, PUT, PATCH, and DELETE requests for a single object. |
| rest_framework.generics.UpdateAPIView | Provides a view that handles HTTP PUT and PATCH requests to update an object. |
| rest_framework.mixins.Mixin | A base class for mixins in DRF. |
| rest_framework.mixins.CreateModelMixin | Provides create behavior for DRF views. |
| rest_framework.mixins.DestroyModelMixin | Provides destroy behavior for DRF views. |
| rest_framework.mixins.ListModelMixin | Provides list behavior for DRF views. |
| rest_framework.mixins.RetrieveModelMixin | Provides retrieve behavior for DRF views. |
| rest_framework.mixins.UpdateModelMixin | Provides update and partial_update behavior for DRF views. |
| rest_framework.serializers.Field | The base class for all DRF serializer fields. |
| rest_framework.serializers.Serializer | The base class for defining custom serializers in DRF. |
| rest_framework.views.APIView | The base class for all DRF views, handling the HTTP protocol and dispatching to appropriate methods. |
| rest_framework.viewsets.GenericViewSet | A base class for all DRF viewsets, providing default implementations for actions. |
| rest_framework.viewsets.ModelViewSet | A viewset that provides default CRUD (Create, Retrieve, Update, Delete) operations. |
| rest_framework.viewsets.ReadOnlyModelViewSet | A viewset that provides default read-only operations (Retrieve, List). |
DRF extensions (https://chibisov.github.io/drf-extensions/docs)
Section titled “DRF extensions (https://chibisov.github.io/drf-extensions/docs)”| Library Component | Description |
|---|---|
| rest_framework_extensions.routers.ExtendedDefaultRouter | An extended version of DRF’s DefaultRouter, providing additional functionality. |
| rest_framework_extensions.routers.ExtendedSimpleRouter | An extended version of DRF’s SimpleRouter, providing additional functionality. |
| Library Component | Description |
|---|---|
| flask.request request.args request.cookies request.files request.form request.headers | A global object representing the incoming request data. |
| flask.Flask | The central object of a Flask application, representing the web application. |
| flask.Blueprint | Class that provides a way to organize Flask applications by grouping related routes and views. |
| flask.views.MethodView | A class-based view that dispatches request methods (GET, POST, etc.) to appropriate handlers. |
| flask.views.RouteCallable | Represents a callable route in Flask views |
| flask.views.View | The base class for creating class-based views in Flask. |
Flask-RESTful
Section titled “Flask-RESTful”| Library Component | Description |
|---|---|
| flask_restful.Api | The central class for creating a Flask-RESTful API. |
| flask_restful.Resource | Represents a REST resource in Flask-RESTful, with methods corresponding to HTTP verbs (GET, POST, etc.) |
FastAPI
Section titled “FastAPI”| Library Component | Description |
|---|---|
| fastapi.FastAPI | The central object of a FastAPI app, representing the web application. |
| fastapi.APIRouter | The entity used to organize routes into reusable modular groups |
| pydantic.BaseModel | A base class for models used as inputs/outputs of FastAPI app’s routes |
| fastapi.Response | A base response class used for manually contructing the response in a route handler |
| fastapi.HTTPException | An exception class used to signal errors in route handlers |
| fastapi.Header, fastapi.Cookie | Typing annotations used to indicate expected input data for route handlers |
| fastapi.status | A module that stores all the HTTP codes used as status codes in route handlers |