def get_schema(self, request=None, public=False): """ Generate a OpenAPI schema. """ reset_generator_stats() result = build_root_object( paths=self.parse(request, public), components=self.registry.build( spectacular_settings.APPEND_COMPONENTS), ) for hook in spectacular_settings.POSTPROCESSING_HOOKS: result = hook(result=result, generator=self, request=request, public=public) # Basically I'm doing it to get pulp logo at redoc page result["info"]["x-logo"] = { "url": "https://pulp.plan.io/attachments/download/517478/pulp_logo_word_rectangle.svg" } # Adding current host as server (it will provide a default value for the bindings) server_url = "http://localhost:24817" if not request else request.build_absolute_uri( "/") result["servers"] = [{"url": server_url}] return normalize_result_object(result)
def get_schema(self, request=None, public=False): """ Generate a OpenAPI schema. """ reset_generator_stats() return build_root_object( paths=self.parse(None if public else request), components=self.registry.build( spectacular_settings.APPEND_COMPONENTS), )
def get_schema(self, request=None, public=False): """ Generate a OpenAPI schema. """ reset_generator_stats() result = build_root_object( paths=self.parse(request, public), components=self.registry.build(spectacular_settings.APPEND_COMPONENTS), ) for hook in spectacular_settings.POSTPROCESSING_HOOKS: result = hook(result=result, generator=self, request=request, public=public) return normalize_result_object(result)