go-kratos / swagger-api Goto Github PK
View Code? Open in Web Editor NEWopenapi for kratos
License: MIT License
openapi for kratos
License: MIT License
readme中说要复制的文件openapiv2.proto无法找到
third_party目录中增加protoc-gen-gorm/proto/options/gorm.proto,用于proto打gorm标记,protoc生成没有问题,但是在访问swagger的时候,服务端就报错,“metadata/server.go:174: protoc-gen-gorm/proto/options/gorm.proto not found"
尝试把protoc-gen-gorm/proto/options/gorm.proto放入api下层,并用kratos client 生成gorm的pb,不能解决
比如说 接口resp需要 {code:11,msg:"bb",body:{resp}} code和msg如何重写?
swagger-api/openapiv2/service.go
Line 52 in d63c4ab
由于我们的API返回的json tag是下划线,因此这里我们期望提交一个PR,支持设置 UseJSONNamesForFields
因此我们先提交了下面的PR,当下面合并之后我们可以更新依赖包,然后继续提交PR来支持options配置UseJSONNamesForFields
go-kratos/grpc-gateway#2
比如日期校验、时间校验?
我按照文档运行了example,访问 http://127.0.0.1:8000/q/swagger-ui/ ,但是返回了404
https://github.com/longXboy/grpc-gateway/blob/master/protoc-gen-openapiv2/generator/generator.go#L11
https://github.com/go-kratos/swagger-api/blob/main/openapiv2/service.go#L52
I found theGenerator.Registry
is not public to developer. I can't use api such as reg.SetUseJSONNamesForFields(false)
, Making public to developer may be better?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.