Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger docs validate failed when enums_as_ints=true #2890

Closed
sysulq opened this issue Jan 31, 2023 · 5 comments
Closed

Swagger docs validate failed when enums_as_ints=true #2890

sysulq opened this issue Jan 31, 2023 · 5 comments

Comments

@sysulq
Copy link

sysulq commented Jan 31, 2023

Problem statement

Here is the
https://github.com/hnlq715/proto/actions/runs/4052643492/jobs/6972309198#step:5:41

Please remove the sections that don't apply

Swagger specification

https://github.com/hnlq715/proto/blob/main/gen/go/api/helloworld/v1/helloworld.swagger.json

Steps to reproduce

Details can be found in this repo https://github.com/hnlq715/proto

Environment

swagger version: v0.30.4
go version: v1.19.5
OS: macos

@sysulq
Copy link
Author

sysulq commented Jan 31, 2023

The swagger spec at "gen/go/api/helloworld/v1/helloworld.swagger.json" is invalid against swagger specification 2.0.
See errors below:
- in operation "GreeterService_SayHello", default value in response 200 does not validate its schema
- 200.data.sex.default in body must be of type integer: "string"
- 200.data.sex.default in body should be one of [1 2]
- in operation "GreeterService_SayHello2", default value in response 200 does not validate its schema
- definitions.v1Sex.default in body must be of type integer: "string"
- definitions.v1Sex.default in body should be one of [1 2]

@sysulq
Copy link
Author

sysulq commented Jan 31, 2023

Everything works fine when generating swagger doc with enums_as_ints=false

https://github.com/hnlq715/proto/actions/runs/4052618200/jobs/6972254556

@sysulq
Copy link
Author

sysulq commented Jan 31, 2023

Here is the PR details: https://github.com/hnlq715/proto/pull/3/files

@sysulq
Copy link
Author

sysulq commented Jan 31, 2023

Emm, seems like this issue should be moved to https://github.com/grpc-ecosystem/grpc-gateway

@fredbi
Copy link
Contributor

fredbi commented Dec 23, 2023

Closing as unrelated to this project

@fredbi fredbi closed this as completed Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants