OpenAPI 3.0 and 3.1 and 3.2 (and Swagger v2) implementation for Go (parsing, converting, validation, and more)
翻译准备中
开发工具Go · ShellGitHub @getkin自行安装运营者未确认
试用过了吗? 点一下就好,无需登录。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A Go project for handling OpenAPI files. We target:
v2.0 (formerly known as Swagger)v3.0v3.1v3.2 Partially: Media Type Object itemSchema, Path Item Object query (the HTTP QUERY method) and additionalOperations (custom HTTP methods).Licensed under the MIT License.
The project has received pull requests from many people. Thanks to everyone!
Please, give back to this project by becoming a sponsor.
Here's some projects that depend on kin-openapi:
net/http"Be sure to check OpenAPI Initiative's great tooling list as well as OpenAPI.Tools.
*openapi3.Schema values for Go types.go run github.com/getkin/kin-openapi/cmd/validate@latest [--defaults] [--examples] [--ext] [--patterns] -- <local YAML or JSON file>
Use openapi3.Loader, which resolves all references:
loader := openapi3.NewLoader()
doc, err := loader.LoadFromFile("my-openapi-spec.json")
When IncludeOrigin is enabled, the loader records the file, line, and column of each element in the OpenAPI document. This is useful for tools that need to report errors or changes with precise source locations (e.g. linters, diff tools, editors).
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗