我在django上运行了一个应用程序。但是我得到了一些urls的错误代码404,即使这些urls是定义的。
from .views import check_secret_key # a function in views.py
from .swagger_schema import SwaggerSchemaView # a class inheriting APIView
from .kom.kom_writer import kom_status # a function
from django.conf.urls i
我需要在每个API中添加无记名令牌,这已在swagger编辑器中记录。但根据我的代码,它并不像预期的那样工作。我在下面解释我的代码。 swagger: "2.0"
info:
description: "This is a sample API documentation of DCI project."
version: "1.0.0"
title: "Swagger API docs for DCI"
termsOfService: "http://swagger.io/terms/"
c
我已经在urls.py中设置了这个url
url(r'^', include('rest_framework_swagger.urls', namespace='swagger')),
由于我不明白的原因,在localhost从localhost加载之后:8000。如果出现此错误,则无法展开任何API:
Unable to read api 'user' from path http://localhost:8000/api-docs/api/v1/user
我认为这是url中的api-docs的问题所在,但是在移除它并重新获取之
我正试图将Swagger添加到现有的spring引导应用程序中,如教程所述。
我的主要应用程序类如下:
@SpringBootApplication
@EnableAutoConfiguration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
挥霍无度的配置是:
@Configuration
@EnableSwagger2
public class SwaggerCon
我正在尝试与swagger-codegen一起工作,以生成基于Swagger资源文件的代码。但是,在试图生成代码时,我遇到了以下错误:
base path is http://my.documentation.com/api/docs/v1.json
java.io.FileNotFoundException: http://my.documentation.com/api/docs/v1.json/authenticateUser
swagger-codegen似乎试图通过在v1.json之后追加操作名来读取方法定义,但我不确定为什么,因为操作名称是在v1.json本身中定义的:
{
我使用的是rails 5.0.0.1和swagger-docs 0.2.9
我只是在遵循github项目的安装步骤,所以我不知道为什么它不能工作
下面是我的config/initializers/swagger_docs.rb:
Swagger::Docs::Config.register_apis(
{
"1.0" => {
# the extension used for the API
:api_exten