swagger 相关问题

Swagger是一个框架实现,用于基于Open API规范描述,生成,使用和可视化RESTful Web服务

我的 springboot 应用程序无法在本地主机上运行 swagger UI

我通过以下依赖项将 swagger 集成到了我的 springboot 应用程序中。 org.springdoc springdoc-

回答 1 投票 0

为什么 Swagger 显示导入项目的端点,而不是主/启动项目

我有一个主要的 API 项目(称为 CustomerLayer),其中仅包含一个控制器和一个端点(UserController/GetAll)。控制器继承自ControllerBase,拥有所有DataAnnotatio...

回答 2 投票 0

如何解决 OpenAPI Generator Maven 插件中的“reference to Type is ambigeous error”?

我的 openapi-generator-maven 插件配置如下 org.openapitools openapi-generator-maven-plugin 我的 openapi-generator-maven 插件配置如下 <plugin> <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <version>7.1.0</version> <configuration> <generateSupportingFiles>true</generateSupportingFiles> <generatorName>spring</generatorName> <generateApiDocumentation>true</generateApiDocumentation> <generateModelDocumentation>true</generateModelDocumentation> <globalProperties> <skipFormModel>false</skipFormModel> </globalProperties> <!-- Duplicate classes being generated due to https://github.com/OpenAPITools/openapi-generator/issues/2701 --> <typeMappings> string+binary=StreamingResponseBody,ExpensePartnerConfig1=ExpensePartnerConfig,FeatureConfig1=FeatureConfig,Application1=Application,PaymentSourceInfo1=PaymentSourceInfo,CostCenter1=CostCenter,OAuthPartnerConfig1=OAuthPartnerConfig,DateTimeRange1=DateTimeRange,TmcInfo1=TmcInfo,Company1=Company,SupportConfig1=SupportConfig,RewardsProgram1=RewardsProgram,CompanyBasicInfo1=CompanyBasicInfo,UserPersonalInfo1=UserPersonalInfo,PnrData1=PnrData,Agent1=Agent,DocumentMetadata1=DocumentMetadata,Document1=Document,BasicTripInfo1=BasicTripInfo,VendorProgramPaymentDescriptor1=VendorProgramPaymentDescriptor,VendorProgramPaymentDescriptorWrapper1=VendorProgramPaymentDescriptorWrapper,WhiteLabelConfig1=WhiteLabelConfig,AirBookTravelerInfo1=AirBookTravelerInfo,UserGroup1=UserGroup,Question1=Question,PaymentSourceMetadata1=PaymentSourceMetadata,EventLocation1=EventLocation,EventUserRsvp1=EventUserRsvp,FormOfPayment1=FormOfPayment,PaymentSourceFilter1=PaymentSourceFilter,PaymentSourceTravelType1=PaymentSourceTravelType,PaymentSourceMappings1=PaymentSourceMappings,PaymentSourceMapping1=PaymentSourceMapping,PaymentSourceSpendType1=PaymentSourceSpendType,PaymentSourceAttributes1=PaymentSourceAttributes,LegalEntityFilter1=LegalEntityFilter,CompanyFilter1=CompanyFilter,CountryFilter1=CountryFilter,CostCenterFilter1=CostCenterFilter,PaymentSourceDepartmentFilter1=PaymentSourceDepartmentFilter,TravelerEventSummary1=TravelerEventSummary,AccessTypeAttributes1=AccessTypeAttributes,TravelTypeFilter1=TravelTypeFilter,PrivacyNotice1=PrivacyNotice </typeMappings> <importMappings> StreamingResponseBody=org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody </importMappings> <configOptions> <oas3>true</oas3> <useTags>true</useTags> <withSeparateModelsAndApi>true</withSeparateModelsAndApi> <delegatePattern>true</delegatePattern> <withInterfaces>true</withInterfaces> <library>spring-boot</library> <dateLibrary>java8</dateLibrary> <useSpringfox>false</useSpringfox> <useSpringController>true</useSpringController> <openApiNullable>false</openApiNullable> <modelPropertyNaming>camelCase</modelPropertyNaming> <useJakartaEe>true</useJakartaEe> </configOptions> <additionalProperties>removeEnumValuePrefix=false</additionalProperties> </configuration> <executions> <execution> <id>generate-client</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${project.basedir}/target/classes/generated/yaml/apis/api/Api.yaml </inputSpec> <generatorName>java</generatorName> <generateApiDocumentation>false</generateApiDocumentation> <modelNamePrefix>Spotnana</modelNamePrefix> <generateModels>true</generateModels> <generateApis>true</generateApis> <library>okhttp-gson</library> <configOptions> <library>okhttp-gson</library> </configOptions> <additionalProperties>removeEnumValuePrefix=true</additionalProperties> <output>${project.build.directory}/generated-sources/openapi/client</output> </configuration> </execution> </executions> </plugin> 我在生成过程中收到以下错误。有人可以建议我如何解决这个问题吗? [ERROR] /Users/debrajmanna/code/java/github/spotnana/src/java/openapi-generator/target/generated-sources/openapi/client/src/main/java/org/openapitools/client/model/ServiceChargeRecord.java:[76,10] error: reference to Type is ambiguous both enum org.openapitools.client.model.Type in org.openapitools.client.model and interface java.lang.reflect.Type in java.lang.reflect match [ERROR] /Users/debrajmanna/code/java/github/spotnana/src/java/openapi-generator/target/generated-sources/openapi/client/src/main/java/org/openapitools/client/model/ServiceChargeRecord.java:[164,41] error: reference to Type is ambiguous 如错误消息中所述,您应该决定在 ServiceChargeRecord.java 类中导入哪一个。 要么: import org.openapitools.client.model.Type; 或者: import java.lang.reflect.Type;

回答 1 投票 0

如何使用FastAPI合并swagger文档?

我有两个 FastAPI 服务在不同的端口上运行: 从 fastapi 导入 FastAPI 应用程序 = FastAPI() @app.get(“/测试”) 异步 def root(): return {"message": "你好,世界...

回答 1 投票 0

如何合并swagger文档

我有两个fastapi服务,它们运行在不同的端口上 从 fastapi 导入 FastAPI 应用程序 = FastAPI() @app.get(“/测试”) 异步 def root(): return {"message": "你好世界&

回答 1 投票 0

OpenAPI(Swagger)配置Quarkus

晚安。我是 Quarkus 的新手,我正在通过 OpenApi 配置 swagger,但是我对其配置有疑问,例如我通过对象组合来处理请求/响应,

回答 2 投票 0

如何在 Node.js 中设置 OpenAPI 3.0.0、Swagger UI 的 basePath

我的控制器中有带有内联 openAPI 注释的路由器。 API 工作正常,但端点的 swagger URL 未附加基本路径,因此我收到 403 禁止...

回答 2 投票 0

无法推断基本 url,Swagger UI 出错

我正在使用 swagger 执行 docs api 并收到错误无法推断基本 url,我在 stackoverflow 上尝试了一些以前的解决方案但不起作用,有人帮助我。 我用的是招摇2.7.0 ...

回答 2 投票 0

additionalProperties: false 在 OpenAPI3.0.2 中不起作用

我使用的是OpenAPI:3.0.2 我的openAPI属性如下: ABC: 类型:对象 附加属性: false 必需的: - 某物 - ID 特性:

回答 1 投票 0

swagger 如何“知道”它在 UI 中显示的主机的 IP?

我正在我的 .net core 6 项目中使用 swagger。我做了所有常规配置: builder.Services.AddSwaggerGen 应用程序UseSwagger 应用程序.UseSwaggerUI 并且带有端点的 swagger 页面一起显示......

回答 1 投票 0

OpenAPI / Swagger 规范路径中的哈希符号意味着什么?

我在 yaml 文件中看到 '/{Bucket}/{Key}#x-amz-copy-source': 例如。我在为特定请求列出的参数中看到这一点,这可能是相关的? (我找不到任何相关文档): -...

回答 1 投票 0

.Net 7 Swagger API JWT 身份验证:使用有效令牌访问端点后出现 HTTP 401(未经授权)

我已经尝试过了 使用有效的 JWT 令牌获取 401 Unauthorized 没有用,因为这不是我的情况。 我刚刚在我的 dotnet 7 API 中实现了 jwt 令牌身份验证,并且令牌已成功生成...

回答 1 投票 0

示例请求正文中 JsonPatchDocument 的 Swagger 意外 API PATCH 操作文档

我正在制作 Core 3.1 Web API 并使用 JsonPatch 创建 PATCH 操作。我有一个名为 Patch 的操作,它有一个 JsonPatchDocument 参数。这是该操作的签名: [HttpPatch("{id}&

回答 2 投票 0

ASP.NET 承载身份验证,不适用于 swagger。正在与邮递员合作

我正在尝试为我的 ASP.NET Web api 设置身份验证。我已使用 Firebase Google 作为我的身份提供商添加了 jwt 身份验证。 当我尝试通过 swagger ui 进行身份验证时,我可以

回答 0 投票 0

如何在NestJS中为swagger添加描述到@ApiTags?

我想添加 api 块的描述。 我努力了: @ApiOperation({ description: '操作说明' }) 没用。

回答 3 投票 0

带有 Swagger 的 CloudFormation API 给出“指定的映射表达式参数无效:method.response.header.Access-Control-Allow-Headers”

我尝试向我的 Api 添加选项端点来修复 CORS 问题。然而,下面的CloudFormation代码给出了一个非常奇怪的错误消息: 日志用户活动API: 类型:AWS::无服务器::Api 部...

回答 1 投票 0

无法使用具有一对多关系的 C# 类中的 Swagger 创建记录

我正在尝试使用 ASP.NET Core API 和 Angular 创建预订类型网站。 我陷入了模型/关系的困境。 这是酒店模型类: 公级酒店 { [钥匙] 公共国际酒店...

回答 1 投票 0

FastAPI swagger ui 中的多帐户授权

我分别创建了“用户”和“商店”路线。 因此,有一个可以访问“用户”帐户的 api,也有一个可以访问“商店”帐户的 api。 # 用户路由.py... oauth2_scheme =

回答 1 投票 0

EF core 构建的 .NET core API 中 Swagger 所需字段错误

我是.NET core 的初学者。我有两个实体,实体技术和实体技能。每个Tech都有一个Skill列表,Skill有Tech的外键。数据库采用EF core构建。 该实体...

回答 1 投票 0

Swagger 仅重定向到 HTTPS,而其他端点则在 HTTP 上工作 - NestJS

我在 Windows Server 环境中运行并由 PM2 管理的 NestJS 服务器上遇到 Swagger 接口的特殊问题。虽然其他端点在 HTTP 上工作,但 Swagger 接口...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.